Skip to content

Commit

Permalink
fix: patch urllib3 ssl module for compatibility (#1672)
Browse files Browse the repository at this point in the history
  • Loading branch information
narasux authored Oct 22, 2024
1 parent 85495f9 commit a8ef634
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apiserver/paasng/paasng/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from typing import Any, Dict, List, Optional

import pymysql
import urllib3
from bkpaas_auth.core.constants import ProviderType
from django.contrib import messages
from django.utils.encoding import force_bytes, force_str
Expand Down Expand Up @@ -85,6 +86,10 @@

_notset = object()

# Patch the SSL module for compatibility with legacy CA credentials.
# https://stackoverflow.com/questions/72479812/how-to-change-tweak-python-3-10-default-ssl-settings-for-requests-sslv3-alert
urllib3.util.ssl_.DEFAULT_CIPHERS = "ALL:@SECLEVEL=1"

pymysql.install_as_MySQLdb()
# Patch version info to forcely pass Django client check
setattr(pymysql, "version_info", (1, 4, 2, "final", 0))
Expand Down

0 comments on commit a8ef634

Please sign in to comment.