http - openssl s_client TLS connection through proxy with clientAuth -


i'd use openssl s_client open tls connection through proxy (squid) origin server using connect request method. using client certificate connect proxy server shown:

openssl s_client -connect my_proxy:4443 -cafile /etc/ssl/ca/ca.crt -cert /etc/ssl/cert/client.crt -key /etc/ssl/key/client_key.pem

after running above, connection information prints out fine , enter connect , methods, , works fine:

connect www.google.com:80 http/1.1 host: www.google.com

http/1.1 200 connection established

get /search?q=ip+address http/1.1 host: www.google.com

http/1.1 200 ok

however, able establish tls (https) connection haven't been able work:

connect www.google.com:443 http/1.1 host: www.google.com

http/1.1 200 connection established

get /search?q=ip+address http/1.1

closed

what doing wrong here? before try openssl 1.1.x has -proxy parameter, i've tried that. note ca cert, client cert , client key on above command connection proxy server, not target server (google.com), shown below openssl 1.1.0-pre3 (same output if try connect google:443).

openssl s_client -connect google.com:80 -proxy my_proxy:4443 -cafile /etc/ssl/ca/ca.crt -cert /etc/ssl/cert/client.crt -key /etc/ssl/key/client_key.pem

connected(00000003)

s_client: http connect failed

no peer certificate available

no client certificate ca names sent ssl handshake has read 0 bytes , written 25 bytes verification: ok

new, (none), cipher (none) secure renegotiation not supported compression: none expansion: none no alpn negotiated

i able load client cert, client key, , ca cert firefox (all bundled in pkcs12 file) , able connect various websites through tls. should possible on command line.

note ca cert, client cert , client key on above command connection proxy server, not -connect server."

i doubt that. according source -proxy used make tunnel through proxy, i.e.

  • makes tcp connect given proxy
  • sends connect request target -connect argument proxy
  • waits response of proxy tunnel got established
  • no certificates involved when creating tunnel, should be

this should possible on command line.

this possible -proxy option. version of s_client don't have option yet can not used alone establish connection through http proxy because necessary functionality not implemented. might try use s_client other tools provide necessary tunnel, socat or proxytunnel.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -