Again: The underlying connection was closed: Could not establish secure channel for SSL/TLS

Discussion in 'ASP .Net Web Services' started by jsanjosem@gmail.com, Sep 29, 2005.

  1. Guest

    I am trying to consume a Web service from ASP.NET that requires a
    certificate. The code I am using is:

    WSClass obj = new WSClass();

    // Load the client certificate from a file.
    X509Certificate x509 =
    X509Certificate.CreateFromCertFile(@"micert.cer");

    // Add the client certificate to the ClientCertificates property
    //of the proxy class.
    obj.ClientCertificates.Add(x509);

    obj.MakeCall(xxxxxxx);

    The certificate is installed in my account, so I granted access to the
    private key to ASPNET user using:

    winhttpcertcfg -i x:\xxx\micert.pfx -p xxxx -c LOCAL_MACHINE\My -a
    ASPNET

    Using this method I managed to have the application work on one
    machine, but I am now trying to install it on another machine (the same
    as the first one, a WXPSP2 box) and I still get:

    The underlying connection was closed: Could not establish secure
    channel for SSL/TLS

    What is it I am missing?, I followed the same process. Any ideas? Thank
    you.
     
    , Sep 29, 2005
    #1
    1. Advertising

  2. GCR Guest

    RE: Again: The underlying connection was closed: Could not establish s

    Even if you grant access to the private key to ASPNET user, the application
    has no knowledge on the location of this key! You should configure a separate
    account for running your ASP.net application and deploy the crertificate in
    this account's profile.

    "" wrote:

    > I am trying to consume a Web service from ASP.NET that requires a
    > certificate. The code I am using is:
    >
    > WSClass obj = new WSClass();
    >
    > // Load the client certificate from a file.
    > X509Certificate x509 =
    > X509Certificate.CreateFromCertFile(@"micert.cer");
    >
    > // Add the client certificate to the ClientCertificates property
    > //of the proxy class.
    > obj.ClientCertificates.Add(x509);
    >
    > obj.MakeCall(xxxxxxx);
    >
    > The certificate is installed in my account, so I granted access to the
    > private key to ASPNET user using:
    >
    > winhttpcertcfg -i x:\xxx\micert.pfx -p xxxx -c LOCAL_MACHINE\My -a
    > ASPNET
    >
    > Using this method I managed to have the application work on one
    > machine, but I am now trying to install it on another machine (the same
    > as the first one, a WXPSP2 box) and I still get:
    >
    > The underlying connection was closed: Could not establish secure
    > channel for SSL/TLS
    >
    > What is it I am missing?, I followed the same process. Any ideas? Thank
    > you.
    >
    >
     
    GCR, Dec 7, 2005
    #2
    1. Advertising

  3. GCR Guest

    RE: Again: The underlying connection was closed: Could not establish s

    Sorry, disregard my previous reply: did you tried installing .NET Framework
    1.1 SP 1 on the secon machine?

    "" wrote:

    > I am trying to consume a Web service from ASP.NET that requires a
    > certificate. The code I am using is:
    >
    > WSClass obj = new WSClass();
    >
    > // Load the client certificate from a file.
    > X509Certificate x509 =
    > X509Certificate.CreateFromCertFile(@"micert.cer");
    >
    > // Add the client certificate to the ClientCertificates property
    > //of the proxy class.
    > obj.ClientCertificates.Add(x509);
    >
    > obj.MakeCall(xxxxxxx);
    >
    > The certificate is installed in my account, so I granted access to the
    > private key to ASPNET user using:
    >
    > winhttpcertcfg -i x:\xxx\micert.pfx -p xxxx -c LOCAL_MACHINE\My -a
    > ASPNET
    >
    > Using this method I managed to have the application work on one
    > machine, but I am now trying to install it on another machine (the same
    > as the first one, a WXPSP2 box) and I still get:
    >
    > The underlying connection was closed: Could not establish secure
    > channel for SSL/TLS
    >
    > What is it I am missing?, I followed the same process. Any ideas? Thank
    > you.
    >
    >
     
    GCR, Dec 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C.W.
    Replies:
    1
    Views:
    5,969
  2. Jim Butler
    Replies:
    7
    Views:
    7,422
    Steven Cheng[MSFT]
    Jul 12, 2006
  3. Joel Barsotti
    Replies:
    4
    Views:
    6,565
    Joel Barsotti
    Apr 20, 2007
  4. Ghislain Tanguay
    Replies:
    3
    Views:
    226
    suresh g
    Sep 3, 2004
  5. C.W.
    Replies:
    1
    Views:
    188
Loading...

Share This Page