ArticleDirectory
- Compile nginx
- Configure nginx
- Android call
Download nginx
Compile nginx with 1.3.15: http://nginx.org/en/download.html
./Configure -- with-http_ssl_moduleWith-http_spdy_module
Make
Make install
Configure nginx to translate the spdy request of port 443 into an HTTP request and forward it to the proxy. For example: https: // 192.168.2.203: 443/API/V1/hotel/search/1 ==> http: // 192.168.0.207: 9602/API/V1/hotel/search/1
Server {Listen 443 SSL spdy; spdy_headers_comp 9; ssl_certificate server. CRT; ssl_certificate_key server. key; # access_log logs/spdy. log; Location/{proxy_pass http: // 192.168.2.207: 9602 ;}}
Android calls client example: https://github.com/square/okhttpconnection this server just built up reports an error
Caused by: Sun. Security. validator. validatorexception: pkix path building failed: Sun. Security. provider. certpath. suncertpathbuilderexception: unable to find valid certification path to requested target
The reason is that the certificate used on the server is not a trusted Certificate (for test purposes, non-public certificate). To add the certificate to the JRE trusted Certificate, refer to: trusted