SSL client/server communication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Nunnally
    New Member
    • Jul 2007
    • 56

    SSL client/server communication

    I'm trying to build a client for a third party application that resides on the server and accepts SSL communication. i'm using this code:

    tcpClient.Conne ct(m_IPAddress, m_Port)

    Dim sslStream As New SslStream(tcpCl ient.GetStream, False, New Net.Security.Re moteCertificate ValidationCallb ack(AddressOf ValidateServerC ertificate))

    sslStream.Authe nticateAsClient (m_IPAddress)

    If sslStream.CanWr ite And sslStream.CanRe ad Then
    Dim bytes(tcpClient .ReceiveBufferS ize) As Byte
    Dim sendBytes As [Byte]() = Encoding.ASCII. GetBytes(XMLStr eam)
    sslStream.ReadT imeout = m_Timeout * 1000
    sslStream.Write (sendBytes, 0, sendBytes.Lengt h)
    sslStream.Read( bytes, 0, CInt(tcpClient. ReceiveBufferSi ze))
    SSLSend = Encoding.ASCII. GetString(bytes )
    Else
    If Not sslStream.CanRe ad Then
    tcpClient.Close ()
    SSLSend = "0"
    Else
    If Not sslStream.CanWr ite Then
    tcpClient.Close ()
    SSLSend = "0"
    End If
    End If
    End If

    On the authenticate as client, I get an exception: A call to SSPI failed, see inner exception. Is the code I have correct? Is this a server problem?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What is the inner exception?
    It will probably contain more insight onto the problem.

    Comment

    • Matt Nunnally
      New Member
      • Jul 2007
      • 56

      #3
      It says "cannot obtain value".

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I am assuming that the underlying exception's message is "cannot obtain value"
        and not that when you try to look at the underlying exception it tells you it cannot see it?

        Comment

        • Matt Nunnally
          New Member
          • Jul 2007
          • 56

          #5
          I'm sorry. It says '"The Local Security Authority cannot be located"

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Originally posted by Matt Nunnally
            I'm sorry. It says '"The Local Security Authority cannot be located"
            hmm, well that's LSASS(.exe). Do you have all that stuff running on that system?

            Comment

            • Matt Nunnally
              New Member
              • Jul 2007
              • 56

              #7
              Yes. It the lsass.exe is running

              Comment

              Working...