Skip to content

Commit d7b253c

Browse files
committed
Try to clear SSL bogus security alert in CI
See: https://github.com/roundup-tracker/roundup/security/code-scanning/107 The server is bound to localhost using a self signed cert on debian. Since this connection is not exposed to the internet, the risk of unathorized disclosure is very low.
1 parent d29bdb2 commit d7b253c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scripts/oauth-get-token.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,19 @@ def do_GET (self):
149149
httpd = HTTPServer (('localhost', port), RQ_Handler)
150150

151151
if self.use_tls:
152-
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
152+
# note this opens a server on localhost. Only
153+
# a process on the same host can get the credentials.
154+
# Even unencrypted (http://) url is fine as the credentials
155+
# will be saved in clear text on disk for use. So a
156+
# compromised local host will still get the credentials.
157+
context = ssl.SSLContext(ssl_version=ssl.PROTOCOL_TLS_SERVER)
158+
159+
# This should not be needed. Uses Python 3.10+ setting.
160+
# context.maximum_version = ssl.TLSVersion.TLSv1_2
161+
# for previous versions maybe:
162+
# ssl.PROTOCOL_TLSv1_2
163+
# would work?
164+
153165
context.load_cert_chain \
154166
( keyfile = self.args.keyfile
155167
, certfile = self.args.certfile

0 commit comments

Comments
 (0)