You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/31 06:33:39 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #3948: fix: make sure SNI is changed with HTTP host

spacewander commented on a change in pull request #3948:
URL: https://github.com/apache/apisix/pull/3948#discussion_r604629243



##########
File path: t/cli/test_access_log.sh
##########
@@ -183,3 +183,44 @@ fi
 make stop
 
 echo "don't log uninitialized access log variable when the HTTP request is malformed"
+
+# TLS upstream
+
+echo "
+apisix:
+    admin_api_mtls:
+        admin_ssl_cert: '../t/certs/apisix_admin_ssl.crt'
+        admin_ssl_cert_key: '../t/certs/apisix_admin_ssl.key'
+    port_admin: 9180
+    https_admin: true
+nginx_config:
+  http:
+    access_log_format: '\"\$upstream_scheme://\$upstream_host\" \$ssl_server_name'
+" > conf/config.yaml
+
+make run
+sleep 2
+
+curl -k -i https://127.0.0.1:9180/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d \
+    '{"uri":"/apisix/admin/routes/1", "upstream":{"nodes":{"localhost:9180":1},"scheme":"https","type":"roundrobin","pass_host":"node"}}'
+
+curl -i http://127.0.0.1:9080/apisix/admin/routes/1
+sleep 4
+tail -n 2 logs/access.log > output.log
+
+# APISIX
+if ! grep '"https://localhost" -' output.log; then
+    echo "failed: find upstream scheme"
+    cat output.log
+    exit 1
+fi
+
+# admin
+if ! grep '"http://localhost" localhost' output.log; then

Review comment:
       `tail -n 2 logs/access.log > output.log`, a few lines above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org