anyproxy icon indicating copy to clipboard operation
anyproxy copied to clipboard

Error proxying https

Open oleza opened this issue 7 years ago • 7 comments

Which platform are you running AnyProxy

Mac

The version of the AnyProxy

4.1.0

Your expected behavior of AnyProxy

Upstream proxying https request.

The actual behavior of AnyProxy

Gives me error.

The log of the error


full log(mirror - mapped to localhost):
$ curl -x https://mirror.com:8007 --proxy-user user:pass -L https://google.com/ -v
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to stream.com (127.0.0.1) port 8007 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS alert, Server hello (2):
* error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure

oleza avatar Aug 02 '19 15:08 oleza

Almost fixed this, but still, get error:

[AnyProxy ERROR][2019-08-02 19:59:49]: err occurred when prepare certs for SNI - Error: Invalid PEM formatted message.

when i pass custom key and cert

oleza avatar Aug 02 '19 17:08 oleza

Screen Shot 2019-08-03 at 10 53 57 AM #409

But works for http requests.

oleza avatar Aug 03 '19 07:08 oleza

Now I'm getting

Error: Client network socket disconnected before secure TLS connection was established

oleza avatar Aug 03 '19 22:08 oleza

Solved by implementing own https proxy agent with CONNECT method realization and injecting it as an agent to AnyProxy.

oleza avatar Aug 06 '19 11:08 oleza

@oleza post your code in beforeDealHttpsRequest pls

mundocruel avatar Mar 23 '20 12:03 mundocruel

@oleza Can you please post your solution for this? Thank you

subratbasnet avatar May 08 '21 02:05 subratbasnet

#431 pls visit this url

MalongGuo avatar Jan 22 '26 17:01 MalongGuo