all groups > dotnet web services > may 2005 >
You're in the

dotnet web services

group:

Problem Accessing web service over SSL


Problem Accessing web service over SSL Siddharth
5/26/2005 10:06:02 PM
dotnet web services:
Hi all,

I have been trying to access a web service over HHTPS but have not been
successful. The client has provided us with a pfx file that is password
protected. I successfully exported the certificate to .cer format.

My code is using WSE to access the web service. I basically load the
certificate from the personal store and attach it to the web service proxy
object. However, I keep getting the error: "The underlying connection was
closed. Could not establish secure channel for SSL/TLS." The certificate has
been given the necessary aspnet permissions and I can even access its various
properties from my code.

Any help regarding this matter will be highly appreciated. I am using .Net
Framework 1.1 SP1 on a XP box. The client's WS is written in java and worked
fine before they enabled SSL. I am guessing the problem has to do with the
private key that probably does not get exported to .cer format.
--
RE: Problem Accessing web service over SSL Brad Roberts
5/27/2005 1:57:50 PM
I may have had something similar before. It seems that the SSL connection may
not get established if the XP box has the local security/encryption setting
for using "FIPS compliant encryption" set. I am currently on a 2000 box so I
can't recall exactly where it is...

[quoted text, click to view]
RE: Problem Accessing web service over SSL Siddharth
5/27/2005 10:42:01 PM
Its already disabled. Yesterday I was able to access the web service using a
Windows application but still no luck with the web app. Also, if I try and
set a web reference to the web service using vs.net, I can see all the web
methods but get the error message "The underlying connection was closed:
Could not establish secure channel for SSL/TLS. The message received was
unexpected or badly formatted"

--
Siddharth Aggarwal


[quoted text, click to view]
RE: Problem Accessing web service over SSL Siddharth
6/2/2005 3:29:02 AM
My final solution:

- Use com+ as discussed in the following msdn article (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod27.asp )

- Use the library provided by mentalis
(http://www.mentalis.org/soft/projects/seclib/)

Both these solutions are working fine for me on Windows XP and 2003.

Make sure you give aspnet and network service accounts permission to the
keys of the certificate. (C:\Documents and Settings\All Users\Application
Data\Microsoft\Crypto\RSA\MachineKeys)

Its amazing how poorly documented this particular problem is. Its taken me a
whole week to finally get it working smoothly.

--
Siddharth Aggarwal


[quoted text, click to view]
AddThis Social Bookmark Button