- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
ID: python-security/insecure-ssl-protocols
Language: Python
Severity: Notice
Category: Security
The following security protocols should never be used in Python: SSLv3
, SSLv2
, TLSv1
. For more details, read the SSL module page of the official documentation.
The issue addresses the CWE-757 - selection of less-secure algorithm during negotiation.
import ssl
def newconnect(self):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
remote = ssl.wrap_socket(s,
ca_certs= CA,
cert_reqs=ssl.CERT_REQUIRED,
ssl_version = ssl.PROTOCOL_SSLv3)
remote.connect(self.server.seradd)
if not self.server.seradd[0] == remote.getpeercert()['subjectAltName'][0][1]:
logging.error('Server crt error !! Server Name don\'t mach !!')
logging.error(remote.getpeercert()['subjectAltName'][0][1])
return
if not self.send_PW(remote):
logging.warn('PW error !')
return
except socket.error, e:
logging.warn(e)
return
import ssl
def newconnect(self):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
remote = ssl.wrap_socket(s,
ca_certs= CA,
cert_reqs=ssl.CERT_REQUIRED,
ssl_version = ssl.PROTOCOL_TLS)
remote.connect(self.server.seradd)
if not self.server.seradd[0] == remote.getpeercert()['subjectAltName'][0][1]:
logging.error('Server crt error !! Server Name don\'t mach !!')
logging.error(remote.getpeercert()['subjectAltName'][0][1])
return
if not self.send_PW(remote):
logging.warn('PW error !')
return
except socket.error, e:
logging.warn(e)
return