Skip to content

Commit 6cf09ab

Browse files
authored
Merge pull request #48 from jiayuan929/fix_ssls
feat: add checkHostName
2 parents 8f8ca34 + 1c7a0ce commit 6cf09ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/conf/settings_env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
if default_cert_file and default_key_file:
5555
default_ssl_options["cert"] = default_cert_file
5656
default_ssl_options["key"] = default_key_file
57+
# 跳过主机名/IP 验证,会降低安全性,正式环境不能开启
58+
check_hostname = env.bool("BK_PAAS_DATABASE_TLS_CHECK_HOSTNAME", True)
59+
default_ssl_options["check_hostname"] = check_hostname
5760

5861
if "OPTIONS" not in DATABASES["default"]:
5962
DATABASES["default"]["OPTIONS"] = {}

0 commit comments

Comments
 (0)