An existing connection was forcibly closed by the remote host

Discussion in 'ASP .Net Web Services' started by Artur, Sep 8, 2005.

  1. Artur

    Artur Guest

    Dear colleagues,

    I've got a problem that I cannot fix for 3 days.

    I have to use remote methods, defined by WSDL at remote host, in my aspx
    pages.
    The methods work through SOAP protocol.

    The communication works well under http protocol. However, the problem is
    make it work through https using client certificate. I've got a certificate
    generated at remote host, that works well when I'm trying to open remote wsdl
    file using IE.

    I have written a ASP.NET application in C# that works with remote methods,
    so I just call the methods of my .dll file in .aspx pages.

    After I tried to connect in C# code of my .dll to remote host using a given
    certificate I 've go an error:

    "An existing connection was forcibly closed by the remote host

    System.Net.Sockets.SocketException: An existing connection was forcibly
    closed by the remote host
    Stack Trace:


    [SocketException (0x2746): An existing connection was forcibly closed by the
    remote host]
    System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size,
    SocketFlags socketFlags) +374
    System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
    size) +108

    [IOException: Unable to read data from the transport connection.]
    System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
    size) +156
    System.Net.TlsStream.ForceRead(Byte[] space, Int32 offset, Int32 amount)
    +40
    System.Net.TlsStream.ReadFullRecord(Byte[] buffer, Int32 length) +253
    System.Net.TlsStream.Handshake(ProtocolToken message) +163

    [WebException: The underlying connection was closed: Could not establish
    secure channel for SSL/TLS.]

    "
    Can anyone help me? I searched many forums and MSDN knowledgebase, bur found
    nothing that solved my problem.

    Thanks in advance, Artur.
     
    Artur, Sep 8, 2005
    #1
    1. Advertising

  2. Artur

    GCR Guest

    It's not really clear how you configured your client certificate: do remember
    that client certificates deploy (together with the corresponding private key)
    in the user profile, so thei'r user-specific. If you've deployed this
    certificate under your account, then the ASP.net application cannot acces the
    private key, and therefor the SSL handshake fails.

    "Artur" wrote:

    > Dear colleagues,
    >
    > I've got a problem that I cannot fix for 3 days.
    >
    > I have to use remote methods, defined by WSDL at remote host, in my aspx
    > pages.
    > The methods work through SOAP protocol.
    >
    > The communication works well under http protocol. However, the problem is
    > make it work through https using client certificate. I've got a certificate
    > generated at remote host, that works well when I'm trying to open remote wsdl
    > file using IE.
    >
    > I have written a ASP.NET application in C# that works with remote methods,
    > so I just call the methods of my .dll file in .aspx pages.
    >
    > After I tried to connect in C# code of my .dll to remote host using a given
    > certificate I 've go an error:
    >
    > "An existing connection was forcibly closed by the remote host
    >
    > System.Net.Sockets.SocketException: An existing connection was forcibly
    > closed by the remote host
    > Stack Trace:
    >
    >
    > [SocketException (0x2746): An existing connection was forcibly closed by the
    > remote host]
    > System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size,
    > SocketFlags socketFlags) +374
    > System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
    > size) +108
    >
    > [IOException: Unable to read data from the transport connection.]
    > System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
    > size) +156
    > System.Net.TlsStream.ForceRead(Byte[] space, Int32 offset, Int32 amount)
    > +40
    > System.Net.TlsStream.ReadFullRecord(Byte[] buffer, Int32 length) +253
    > System.Net.TlsStream.Handshake(ProtocolToken message) +163
    >
    > [WebException: The underlying connection was closed: Could not establish
    > secure channel for SSL/TLS.]
    >
    > "
    > Can anyone help me? I searched many forums and MSDN knowledgebase, bur found
    > nothing that solved my problem.
    >
    > Thanks in advance, Artur.
    >
     
    GCR, Dec 7, 2005
    #2
    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. Replies:
    5
    Views:
    11,622
    Esmond Pitt
    Mar 3, 2005
  2. iKiLL
    Replies:
    0
    Views:
    499
    iKiLL
    Dec 20, 2006
  3. Anbu
    Replies:
    4
    Views:
    570
    Juan T. Llibre
    Mar 13, 2007
  4. iKiLL
    Replies:
    0
    Views:
    662
    iKiLL
    Dec 20, 2006
  5. Wil Peck
    Replies:
    2
    Views:
    965
    Wil Peck
    Jan 17, 2008
Loading...

Share This Page