-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shrpx front-end proxy error: decryption_failed(21). #124
Comments
It seems nobody pay attention to this ... |
From the log, I see SPDY protocol is not negotiated in backend. Check that backend SPDY proxy supports NPN. |
In fact, I know little about the proxy (I buy the service of the proxy, but it just support Chrome browser by a plugin), and the proxy works OK when using a pac-script in chrome, like "return 'HTTPS 106.187.39.217:443' ". I capture the packets, and it occur exactly the same negotiation(including tls version and cipher suites), without decryption_failed(21). So I think something wrong with the key-file or cacert. The debugging info in Chrome is really cool! When it works OK, I get the SPDY session info as follow : 87493: SPDY_SESSION t=344605 [st= 0] +SPDY_SESSION [dt=?] 87472: CONNECT_JOB t=343823 [st= 0] +SOCKET_POOL_CONNECT_JOB [dt=103] t=343823 [st=0] +HOST_RESOLVER_IMPL_REQUEST [dt=0] t=343823 [st=0] +HOST_RESOLVER_IMPL_REQUEST [dt=0] t=343823 [st= 0] +SOCKET_ALIVE [dt=225564]
t=344029 [st= 206] SOCKET_BYTES_SENT
t=344579 [st= 756] SSL_SOCKET_BYTES_SENT |
--cacert: CA certificates shrpx trusts when connecting backend connection. If backend host uses self-signed certs and you'd like to make sure that it is really is, specify its cert here. --client-private-key-file and --client-cert-file: Specify client private key and certificate file. They are only required if backend TLS server requires them. Usually backend server service says somethings about this; for example, signing your client certs with their keys. |
(get the file from http://pan.baidu.com/s/1mgNx5Mg)
I use shrpx as a front-end proxy, connect to another spdy proxy. But encounter a error of decryption_failed(21). I try google a lot, but there so few material for reading.
The backend server "106.187.39.217,443" is a spdy proxy, and it work OK if I use it in a pac-file on Chrome.
I know not much about openssl, but I make the crt-file by openssl using the following command.
openssl genrsa -out ca.key 1024
openssl req -new -key ca.key -out ca.csr
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
The shrpx option used:
src/shrpx -p --backend=106.187.39.217,443 --frontend=0.0.0.0,8808 --log-level=INFO --insecure --cacert=/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --client-private-key-file=/etc/pki/CA/private/ca.key --client-cert-file=/etc/pki/CA/certs/ca.crt --tls-proto-list=TLSv1.0
It seems no error in the log:
[INFO] Resolving backend address
(shrpx.cc:1183)
[INFO] Address resolution for 106.187.39.217 succeeded: 106.187.39.217
(shrpx.cc:105)
[INFO] Unable to get IPv6 address for 0.0.0.0: Address family for hostname not supported
(shrpx.cc:148)
[INFO] Listening on 0.0.0.0, port 8808
(shrpx.cc:186)
[INFO] Entering event loop
(shrpx.cc:299)
[INFO] [LISTEN:0x1000260] Accepted connection. fd=9
(shrpx_listen_handler.cc:101)
[INFO] [UPSTREAM:0xfe3a00] HTTP request started
(shrpx_https_upstream.cc:78)
[INFO] [UPSTREAM:0xfe3a00] HTTP request headers completed
(shrpx_https_upstream.cc:135)
[INFO] [UPSTREAM:0xfe3a00] HTTP request headers
CONNECT clients4.google.com:443 HTTP/1.1
Host: clients4.google.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
[INFO] [CLIENT_HANDLER:0xfd5dd0] Downstream connection pool is empty. Create new one
(shrpx_client_handler.cc:309)
[INFO] [DCONN:0xfbd720] Attaching to DOWNSTREAM:0xfd6070
(shrpx_spdy_downstream_connection.cc:101)
[INFO] [UPSTREAM:0xfe3a00] Downstream output buffer is full
(shrpx_https_upstream.cc:311)
[INFO] [DSPDY:0xfd6130] Connecting to downstream server
(shrpx_spdy_session.cc:393)
[INFO] [DSPDY:0xfd6130] Connection established
(shrpx_spdy_session.cc:249)
[INFO] [DSPDY:0xfd6130] Negotiated next protocol:
(shrpx_spdy_session.cc:1049)
[INFO] [DSPDY:0xfd6130] Disconnecting
(shrpx_spdy_session.cc:72)
[INFO] [DSPDY:0xfd6130] Closing fd=10
(shrpx_spdy_session.cc:103)
[INFO] [CLIENT_HANDLER:0xfd5dd0] Deleting
(shrpx_client_handler.cc:173)
[INFO] [DOWNSTREAM:0xfd6070] Deleting
(shrpx_downstream.cc:67)
[INFO] [DCONN:0xfbd720] Deleting
(shrpx_spdy_downstream_connection.cc:59)
[INFO] [DCONN:0xfbd720] Deleted
(shrpx_spdy_downstream_connection.cc:76)
[INFO] [DOWNSTREAM:0xfd6070] Deleted
(shrpx_downstream.cc:77)
[INFO] [CLIENT_HANDLER:0xfd5dd0] Deleted
(shrpx_client_handler.cc:202)
[INFO] [LISTEN:0x1000260] Accepted connection. fd=9
(shrpx_listen_handler.cc:101)
[INFO] [CLIENT_HANDLER:0xfd5dd0] EOF
(shrpx_client_handler.cc:83)
[INFO] [CLIENT_HANDLER:0xfd5dd0] Deleting
(shrpx_client_handler.cc:173)
[INFO] [CLIENT_HANDLER:0xfd5dd0] Deleted
(shrpx_client_handler.cc:202)
[INFO] [LISTEN:0x1000260] Accepted connection. fd=9
(shrpx_listen_handler.cc:101)
[INFO] [UPSTREAM:0x101d470] HTTP request started
(shrpx_https_upstream.cc:78)
[INFO] [UPSTREAM:0x101d470] HTTP request headers completed
(shrpx_https_upstream.cc:135)
[INFO] [UPSTREAM:0x101d470] HTTP request headers
GET http://www.baidu.com/ HTTP/1.1
Host: www.baidu.com
Proxy-Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: BAIDUID=1BA2C2A8FF4226E396526FE4BE6B740E:FG=1; BAIDUPSID=1BA2C2A8FF4226E396526FE4BE6B740E; BD_HOME=0; H_PS_PSSID=10382_1444_10571_10211_10501_10496_10753_10646_10459_10219_10687_10356_10666_10596_10096_10657_10443_10699_10403_10360_10617_10702_10627; BD_UPN=1b314353
[INFO] [CLIENT_HANDLER:0xfd5dd0] Downstream connection pool is empty. Create new one
(shrpx_client_handler.cc:309)
[INFO] [DCONN:0xf2f400] Attaching to DOWNSTREAM:0xfed6c0
(shrpx_spdy_downstream_connection.cc:101)
[INFO] [UPSTREAM:0x101d470] HTTP request completed
(shrpx_https_upstream.cc:227)
[INFO] [DSPDY:0xfd6130] Connecting to downstream server
(shrpx_spdy_session.cc:393)
[INFO] [LISTEN:0x1000260] Accepted connection. fd=11
(shrpx_listen_handler.cc:101)
[INFO] [UPSTREAM:0x10177f0] HTTP request started
(shrpx_https_upstream.cc:78)
[INFO] [UPSTREAM:0x10177f0] HTTP request headers completed
(shrpx_https_upstream.cc:135)
The text was updated successfully, but these errors were encountered: