Re: Consuming WebService using SSL and Authenticated with X509 Certifi
- From: "Kay-Christian Wessel" <kayhanse@xxxxxxxx>
- Date: Fri, 1 Sep 2006 02:11:30 +0200
I think when you Open the store you need to specify MaxAllowed as a
parameter.
Best regards
Kay
"David G" <David G@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5BDBB8C0-B507-4A61-90C6-C4CC12CDFB42@xxxxxxxxxxxxxxxx
My company has a Webservice that is currently running in production. It
is
secured using SSL and clients are authenticated using X509 certificates.
I am able to consume the Webservice methods in a Framework 2.0 c# Forms
based application where I instantiate the X509 Certificate by pointing to
the
certificate file and passing the password:
//====================
X509Certificate cert = new X509Certificate(this.tbCertFilePath.Text,
this.tbCertificatePassword.Text);
myWebService.ClientCertificates.Add(cert);
string k = myWebService.GetMyDataByYear(2004);
//====================
However, we are trying to instantiate the X509 Certificate using the
LocalMachineStore in a Framework 2.0 c# Web App:
//====================
X509CertificateStore store;
store =
X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);
byte[] certHash = new byte[]{0x28, 0x83, 0xf0, ...};
bool open = store.OpenRead();
Microsoft.Web.Services2.Security.X509.X509CertificateCollection certs =
store.FindCertificateByHash(certHash);
Microsoft.Web.Services2.Security.X509.X509Certificate cert = certs[0];
myWebService.ClientCertificates.Add(cert);
string k = myWebService.GetMyDataByYear(2004);
//====================
I am able to verify that the X509 Certificate is in fact being retrieved
and
is being placed in the myWebService.ClientCertificates collection. The
problem occurs when I try to consume the Webservice. I am getting the
following exceptions:
[SocketException (0x274d): No connection could be made because the target
machine actively refused it]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) +1002146
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetRequestStream() +1504525
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) +103
DbTest.com.WebServerName.GlobalOrganizerXML.GetAssigneeList(Int32
taxYear) in d:\webapps\DbTest\App_Code\GlobalOrganizerXML.cs:79
DbTest.WebForm1.Page_Load(Object sender, EventArgs e) in
d:\webapps\DbTest\WebForm1.aspx.cs:65
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--Thanks in advance
.
- Prev by Date: Re: How do I pass a message or variable to a web service?
- Next by Date: Re: How do I pass a message or variable to a web service?
- Previous by thread: Re: Custom Serializable Objects
- Next by thread: Re: two webservice proxies
- Index(es):
Relevant Pages
|