473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Could not establish secure channel for SSL/TLS ?

hello,

my client code communicates with a web service through a https connection.
the code has a stub derived from SoapHttpClientProtocol. It also sets a
certificate policy handler that allows everything:

class CertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint servicepoint,
X509Certificate certificate, WebRequest request, int problem) { return
true; }
}

but some users reported the below exception when the client code calls
Invoke on the stub.

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. ---> System.IO.IOException: Unable to
read data from the transport connection. ---> System.IO.IOException: Unable
to read data from the transport connection. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebReques
t request)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
...

I asked one of the users who have this problem to navigate to the web
service url in IE browser, and it worked, and showed the help page for the
service with the list of methods, etc. No certificate warnings were
displayed, nothing.

I am confused.

Could someone help?
thank you
konstantin
Nov 21 '05 #1
4 15467
The message you are getting is misleading you.

I got the same problem days ago, it appears that the web methods kicks an
exception, and your code is not handling it properly.

I guess your event view has some weird message as well on the server.

Solution is to trace down the exception on the web server and fix it.

Hope this helps.

csheng

"konsu" wrote:
hello,

my client code communicates with a web service through a https connection.
the code has a stub derived from SoapHttpClientProtocol. It also sets a
certificate policy handler that allows everything:

class CertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint servicepoint,
X509Certificate certificate, WebRequest request, int problem) { return
true; }
}

but some users reported the below exception when the client code calls
Invoke on the stub.

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. ---> System.IO.IOException: Unable to
read data from the transport connection. ---> System.IO.IOException: Unable
to read data from the transport connection. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebReques
t request)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
...

I asked one of the users who have this problem to navigate to the web
service url in IE browser, and it worked, and showed the help page for the
service with the list of methods, etc. No certificate warnings were
displayed, nothing.

I am confused.

Could someone help?
thank you
konstantin

Nov 21 '05 #2
thank you for your response.

this does not explain why the other users are able to communicate with the
web service successfully, and this particular one cannot. All requests fail
for this particular user.

konstantin
"csheng" <cs****@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
The message you are getting is misleading you.

I got the same problem days ago, it appears that the web methods kicks an
exception, and your code is not handling it properly.

I guess your event view has some weird message as well on the server.

Solution is to trace down the exception on the web server and fix it.

Hope this helps.

csheng

"konsu" wrote:
hello,

my client code communicates with a web service through a https connection. the code has a stub derived from SoapHttpClientProtocol. It also sets a
certificate policy handler that allows everything:

class CertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint servicepoint,
X509Certificate certificate, WebRequest request, int problem) { return
true; }
}

but some users reported the below exception when the client code calls
Invoke on the stub.

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. ---> System.IO.IOException: Unable to read data from the transport connection. ---> System.IO.IOException: Unable to read data from the transport connection. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest request)
at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebReques t request)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
...

I asked one of the users who have this problem to navigate to the web
service url in IE browser, and it worked, and showed the help page for the service with the list of methods, etc. No certificate warnings were
displayed, nothing.

I am confused.

Could someone help?
thank you
konstantin

Nov 21 '05 #3
Hi, I meet the same problem, did you find out the cause?
Thanks!
Hui

hello,

my client code communicates with a web service through a https connection.
the code has a stub derived from SoapHttpClientProtocol. It also sets a
certificate policy handler that allows everything:

class CertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint servicepoint,
X509Certificate certificate, WebRequest request, int problem) { return
true; }
}

but some users reported the below exception when the client code calls
Invoke on the stub.

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. ---> System.IO.IOException: Unable to
read data from the transport connection. ---> System.IO.IOException: Unable
to read data from the transport connection. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebReques
t request)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
...

I asked one of the users who have this problem to navigate to the web
service url in IE browser, and it worked, and showed the help page for the
service with the list of methods, etc. No certificate warnings were
displayed, nothing.

I am confused.

Could someone help?
thank you
konstantin


User submitted from AEWNET (http://www.aewnet.com/)
Nov 23 '05 #4
I also meet this problem, did you find out the reason Thanks!

hello,

my client code communicates with a web service through a https connection.
the code has a stub derived from SoapHttpClientProtocol. It also sets a
certificate policy handler that allows everything:

class CertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint servicepoint,
X509Certificate certificate, WebRequest request, int problem) { return
true; }
}

but some users reported the below exception when the client code calls
Invoke on the stub.

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. ---> System.IO.IOException: Unable to
read data from the transport connection. ---> System.IO.IOException: Unable
to read data from the transport connection. --->
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse(WebReques
t request)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
...

I asked one of the users who have this problem to navigate to the web
service url in IE browser, and it worked, and showed the help page for the
service with the list of methods, etc. No certificate warnings were
displayed, nothing.

I am confused.

Could someone help?
thank you
konstantin


User submitted from AEWNET (http://www.aewnet.com/)
Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: C.W. | last post by:
I am trying to connect to a remote server in order to perform an http post inside my asp.net page. However, I consistently get the following error: System.Net.Sockets.Socket.Receive(Byte...
3
by: Bill | last post by:
I'm running a C#.Net application that is using the HttpWebRequest to upload an xml file to a https site with FIPS complicancy turned on. On the "GetRequestStream()" method I get: "The underlying...
1
by: Mark Richards | last post by:
Hi, I am interfacing with another company using web services (they are a java shop). We've been doing this for over 2 years, but a couple months age we started getting this error randomly. It...
1
by: Rob Thompson | last post by:
Hi, We are using web services that are secured using SSL, everything works fine, but every now and then we get an error: >>START<< System.Net.WebException: The underlying connection was...
0
by: Ryan Michela | last post by:
Hello all, I am trying to access our SOAP web service over an HTTPS connection and am getting the infamous "Could not establish secure channel for SSL/TLS" error. The client program works at all...
0
by: Chris | last post by:
I am seeing the error "Could not establish secure channel for SSL/TLS" intermittently in my application. I am simply trying to connect to a HTTP server via SSL. Five out of ten times it throws...
0
by: Nathan Alden | last post by:
This error will appear intermittently and seemingly for no reason when my Web service tries to contact another Web service over the Internet using SSL. I'd say about 80-90% of all the requests work...
7
by: Jim Butler | last post by:
I have this error that is happening on all of our web servers (production included). It basically started occurring once we loaded 2005 sql client tools, asp.net 2.0 (and all related prerequistes)...
4
by: Joel Barsotti | last post by:
I'm working on shipping rate calculator going back and forth via XML. The thing I'm confused about is that the code works, but after a few hours and I don't know how many requests, I start getting...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.