如何使squid代理接受自簽名憑證?

如何使squid代理接受自簽名憑證?

我有一個用例,我必須接受 Squid 中的自簽名憑證。端點是使用自簽名憑證的 Kubernetes 叢集。叢集將根據需要使用不同的自簽名憑證重新創建,因此需要使用正規表示式、首選方式或全域接受它們以用於測試目的。

目前的 Squid 版本是 6.0.0,使用以下標誌編譯:

Squid Cache: Version 6.0.0-VCS                                                                                                                                             
Service Name: squid                                                                                                                                                        
                                                                                                                                                                           
This binary uses OpenSSL 1.1.1  11 Sep 2018. For legal restrictions on distribution see https://www.openssl.org/source/license.html                                        
                                                                                                                                                                           
configure options:  '--prefix=/apps/squid' '--enable-icap-client' '--enable-ssl' '--with-openssl' '--enable-ssl-crtd' '--enable-security-cert-generators=file' '--enable-au
th' '--with-default-user=proxy'                                                                                                                                            

在我的測試中,我使用了 ssl_bump 配置和 tls_outgoing_options:

http_port 8080 ssl-bump cert=/apps/squid/etc/ssl_cert/CA_crt.pem key=/apps/squid/etc/ssl_cert/CA_key.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB 
sslcrtd_program /apps/squid/libexec/security_file_certgen -s /apps/squid/var/logs/ssl_db -M 4MB
sslcrtd_children 5
ssl_bump bump all
sslproxy_cert_error allow all
tls_outgoing_options options=ALL flags=DONT_VERIFY_PEER,DONT_VERIFY_DOMAIN

但我能達到的最好結果是_curl: (51) SSL: no alternative certificate subject name matches target host name

或沒有 ssl_bump

http_port 8080 ssl-bump cert=/apps/squid/etc/ssl_cert/CA_crt.pem key=/apps/squid/etc/ssl_cert/CA_key.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
sslcrtd_program /apps/squid/libexec/security_file_certgen -s /apps/squid/var/logs/ssl_db -M 4MB
sslcrtd_children 5
sslproxy_cert_error allow all
tls_outgoing_options options=ALL flags=DONT_VERIFY_PEER,DONT_VERIFY_DOMAIN

我明白了curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to

今天我需要 K8S 端點,但明天可以是任何其他端點,因此需要讓魷魚創建欺騙 CN 的連接。

相關內容