5

My servers has been recently upgraded to support TLS 1.2 and rest other (TLS 1.0 and TLS 1.1.) has been disabled. Now when I tries to generate the reference it gives me following exception:

service Url = https://server-name/service.asmx

Error: Cannot obtain Metadata from "service url" If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: "service url" Metadata contains a reference that cannot be resolved: "service url". An error occurred while making the HTTP request to "service url" 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. The underlying connection was closed: An unexpected error occurred on a send. Received an unexpected EOF or 0 bytes from the transport stream. HTTP GET Error URI: "service url" There was an error downloading "service url". The underlying connection was closed: An unexpected error occurred on a send. Received an unexpected EOF or 0 bytes from the transport stream.

I tried the solution at following link but didn't worked for me, Kindly help.

support.microsoft.com/kb/888528

2 Answers 2

7

We recently ran into this exact issue, after PCI compliance forced us to blanket-disable SSL3 and TLS 1.0. Ultimately, the best solution we found was the same one that client apps are using to allow connectivity to web services on .NET 4.5+; namely, adding some code to adjust that setting for Visual Studio at runtime. In the most basic form, that looks like this:

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;

We did this via a VS package with a simple configuration UI, which is available in the visual studio gallery, if you want a drop-in solution:

https://visualstudiogallery.msdn.microsoft.com/63750942-1ebe-45dd-bade-552dd850873e

If you'd rather handle it yourself, all you need to do is create a VSIX package or an Add-In (both of which require the visual studio sdk).

Good luck!

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

2 Comments

This worked. For more information, you need to install the addin, then (after restarting VS, I think) go to Tools -> Security Protocol Manager 2013. Then you can enable the settings you need.
@MattDawdy I did the same as you mentioned above, but my visual studio get crashed after adding the service reference. urgent help would be appreciated
0

I faced the same issue also, i was not able to add service reference in visual studio.

But after installing the Add-In and enabling the TLS1.2 in visual studio, I was able to update the service reference.

Tools -> Security Protocol Manager 2013

screenshot

https://visualstudiogallery.msdn.microsoft.com/63750942-1ebe-45dd-bade-552dd850873e

I was getting error:

The request was aborted: Could not create SSL/TLS secure channel. Metadata contains a reference that cannot be resolved: An error occurred while making the HTTP request to https://...Service.svc. 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. The underlying connection was closed: An unexpected error occurred on a send. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.