Results 1 to 5 of 5

Thread: [RESOLVED] Problems testing Web Server.

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,470

    Resolved [RESOLVED] Problems testing Web Server.

    This is not directly related to VB6, but I am trying to use OpenSSL to test my VB6 secure web server. I can get past the handshake with no problem using:
    openssl s_client -connect localhost:443

    Where I run into trouble is sending a multi line GET request.
    GET / HTTP/1.1
    Host: localhost:443
    The Host line is required by HTTP 1.1.

    It sends the lines one at a time, which my server cannot handle. I run into the same problem with outside web servers, and I have tried numerous suggestions from online searches to no avail.

    Anyone have experience with this?

    J.A. Coutts

  2. #2
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Problems testing Web Server.

    Quote Originally Posted by couttsj View Post
    It sends the lines one at a time, which my server cannot handle. I run into the same problem with outside web servers, and I have tried numerous suggestions from online searches to no avail.
    You have to deal with fragmentation -- that's just the way network communications work in general. The underlying protocol can chunk traffic at random boundaries and your parsing routine has to be prepared to buffer data until separator or expected length in reached.

    For http this means buffering until double vbCrLf appears in the buffer which signifies the end of headers. Each http server has a setting how big this headers buffer should be so not to be able to DoS the service with random sending clients.

    I'm curious which public http servers fail on chunked traffic.

    cheers,
    </wqw>

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,470

    Re: Problems testing Web Server.

    With a lot of research and a bit of trial & error, I was able to find a solution. To start the handshake:
    openssl s_client -connect www.google.ca:443 -quiet

    The handshake returns:
    "Verify return code: 20 (unable to get local issuer certificate)", whereas connecting to my server returns:
    "Verify return code: 18 (self signed certificate)".
    The quiet option simply reduces all the handshake information. Then:
    GET / HTTP/1.1(CrLf)
    Host: google.ca:443(CrLf)
    (CrLf)

    Nothing happens until I input:
    Connection: close(CrLf)

    There is a limited amount of time to close the connection (10 seconds?)

    J.A. Coutts

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,470

    Re: Problems testing Web Server.

    Quote Originally Posted by wqweto View Post
    You have to deal with fragmentation -- that's just the way network communications work in general. The underlying protocol can chunk traffic at random boundaries and your parsing routine has to be prepared to buffer data until separator or expected length in reached.

    cheers,
    </wqw>
    It does deal with fragmentation, but unfortunately during the handshake there are two sets of headers one unecrypted and one encrypted. The socket routine was never designed to deal with the second header.

    J.A. Coutts

  5. #5
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: [RESOLVED] Problems testing Web Server.

    It works here. Just a

    GET / HTTP/1.1(CrLf)
    Host: google.ca:443(CrLf)
    (CrLf)

    . . . returns a redirect to www.google.ca and the connection does *not* get closed.

    Btw, port is optional for Host header and I've never seen browsers (or any other client) include it. Probably they might include it when reaching the an http/https server on a non-standard port though.

    cheers,
    </wqw>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width