0

We are trying to access a java webservice through HTTPS from remote system in to our .net client system.we are facing an error:

This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server

Interesting thing is it is working in SOAP UI,but only problem with visual studio.Why it is working in soap UI rather not in Visual studio2010

protected void Page_Load(object sender, EventArgs e) { try { ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(CertificationvAlidatefunction); mainclass.ClientCredentials.UserName.UserName = "testuser"; mainclass.ClientCredentials.UserName.Password = "test123"; response = mainclass.Testmethod(request); } catch (Exception ex) { Response.Write(ex.Message); } } private bool CertificationvAlidatefunction(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, SslPolicyErrors errors) { return true; 

}

6
  • Which is the error? Is the text you inserted as code? "This could be due to the fact..."? Commented Dec 20, 2018 at 6:44
  • yes that is the one,But in SOAP UI works Fine Commented Dec 20, 2018 at 6:44
  • presently add service reference and got the error Commented Dec 20, 2018 at 7:10
  • do you have access to a more recent version of visual studio? Commented Dec 20, 2018 at 7:24
  • no i dont have.I have only VS 2010 Commented Dec 20, 2018 at 7:27

1 Answer 1

1

It is possible that the dotnet framework is related to the version of TLS supported. As far as I know,. Net4.0 is not compatible with tls1.2,you could refer to the following question for details.
Which versions of SSL/TLS does System.Net.WebRequest support?
Set up the configuration by using the following code snippets.

 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11; ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new X509ServiceCertificateAuthentication() { CertificateValidationMode = X509CertificateValidationMode.None, RevocationMode = X509RevocationMode.NoCheck }; 

Feel free to let me know If there is anything I can help with.

Sign up to request clarification or add additional context in comments.

2 Comments

Why soapUI has TLS 1.1 where OS doesnot have,or even ,net does not have??Does it cause issue?
Tls1.1 is already supported as long as you install Net4.0 (vs2010 built-in). So soapui has been set to use tls1.1 by default. However, this option needs to be explicitly setup in the program. Have you tried to set this option in the program?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.