Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DQM] Update visDQMUpload.py to pyhon3 #34424

Merged
merged 1 commit into from Jul 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions DQMServices/FileIO/scripts/visDQMUpload.py
Expand Up @@ -7,6 +7,7 @@
import string
import mimetypes
import http.client as httplib
import ssl
import gzip
import hashlib
from stat import *
Expand All @@ -33,10 +34,15 @@

ssl_key_file = None
ssl_cert_file = None
context = None

class HTTPSCertAuth(HTTPS):
def __init__(self, host, *args, **kwargs):
HTTPS.__init__(self, host, key_file = ssl_key_file, cert_file = ssl_cert_file, **kwargs)
def __init__(self, host, context = None, *args, **kwargs):
if context is None:
context = ssl._create_default_https_context()
if ssl_key_file or ssl_cert_file:
context.load_cert_chain(ssl_cert_file, ssl_key_file)
HTTPS.__init__(self, host, context = context, **kwargs)

class HTTPSCertAuthenticate(urllib2.AbstractHTTPHandler):
def default_open(self, req):
Expand Down