Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
912 views
in Technique[技术] by (71.8m points)

wcf - Unable to add service reference SSL

There was an error downloading '_vti_bin/ListData.svc/$metadata'.

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.

An existing connection was forcibly closed by the remote host

Metadata contains a reference that cannot be resolved: 'https://dummy.svc'.

An error occurred while making the HTTP request to https://dummy.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.

An existing connection was forcibly closed by the remote host

If the service is defined in the current solution, try building the solution and adding the service reference again.

question from:https://stackoverflow.com/questions/65547095/unable-to-add-service-reference-ssl

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Gradually, web servers switch to new security protocols and delete security protocols that are not recommended, so this may be the cause of your error. Usually, .net will automatically find common security protocols, but sometimes you need to use ServicePointManager.SecurityProtocol performs display update.You can try the following code to force the latest protocol type.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13;

About SecurityProtocolType.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...