Description
I'm seeing an issue when connecting to a server using https through a http proxy using basic authentication (username/password). The exception returned from request is "Error in SSL handshake"
I am able to make the connection successfully without proxy authentication. Also I have done a curl test which succeeds with/without authentication
Looking through packet traces in wireshark I see the following
with curl
1: curl -> to proxy: CONNECT
2: proxy -> curl: Proxy Authentication Required
3: curl-> proxy: CONNECT with Authentication
4: proxy -> curl sdk Conection established
5 curl -> proxy client Hello to server url
6 proxy -> server Client Hello
7 server -> proxy Server Hello
8: proxy -> sdk Server Hello
... Successfully completes TLS handshake
with cpprestsdk
1: sdk -> proxy: CONNECT with auth
It looks like with sdk we just have one authentication scheme (BASIC) and don't do the authentication discovery step like curl above. Is this correct?
2: proxy -> sdk connection established
3: sdk -> proxy Client Hello
4: stray packet with protocol SSL going to server, wireshark marks this packet as "Continuation Data"
5: proxy -> server Client Hello
6: server -> sdk FIN, ACK terminating the connection
I believe the server ins't completing the handshake because of that stray packet in step 4. I cannot tell what is generating this packet. I do not see this packet being sent from sdk to proxy. I was wondering if this packet might be generated because of the way the connection to the http proxy is formed. I compared at the Client Hello packets between successful and failed attempts and those seem to match up.
I have tested on mac and linux with the squid proxy.