@shenvsv The following tested example accesses the https site of google search from within Lua via subrequests:
location/google{internal;rewrite^/google(.*)$1break;# to strip the leading /google prefix in subrequestsproxy_set_headerAccept-Encoding'';# to disable gzip compression on the backendproxy_passhttps://www.google.com;}location=/t{content_by_lua'--searchfor"openresty"ingoogleoverhttps:localres=ngx.location.capture("/google/search",{args={q="openresty"}})ifres.status~=200thenngx.say("failedtoquerygoogle:",res.status,":",res.body)returnend--herewejustforwardtheGooglesearchresultpageintact:ngx.header["Content-Type"]="text/html;charset=UTF-8"ngx.say(res.body)';}
I've implemented the SSL/TLS cosocket API in the ssl-cosocket git branch. Please check out my latest comment on #290 for more details: #290 (comment) Feedback welcome :)
The ssl-cosocket branch has been merged into master. I'm closing this ticket. If you have any further issues with the SSL cosocket implementation, please file new separate tickets.
@shenvsv The following tested example accesses the https site of google search from within Lua via subrequests: