Skip to content

Commit 9a75469

Browse files
committed
Made it work better with Python3.5
1 parent 255c34e commit 9a75469

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

example/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
idp/idp_conf.py
22
idp2/idp.subject
3-
idp2/idp_conf.py
3+
idp2/test_idp_conf.py
44
sp/outstanding
55
sp/sp_conf.py
66
server.crt

example/idp2/idp.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
import re
88
import time
99

10-
from Cookie import SimpleCookie
10+
#from Cookie import SimpleCookie
1111
from hashlib import sha1
12-
from urlparse import parse_qs
12+
#from urlparse import parse_qs
1313
from cherrypy import wsgiserver
14-
from cherrypy.wsgiserver import ssl_pyopenssl
14+
#from cherrypy.wsgiserver import ssl_pyopenssl
15+
from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter
16+
from future.backports.http.cookies import SimpleCookie
17+
from future.backports.urllib.parse import parse_qs
1518

1619
from saml2 import BINDING_HTTP_ARTIFACT
1720
from saml2 import BINDING_URI
@@ -1088,10 +1091,13 @@ def application(environ, start_response):
10881091

10891092
_https = ""
10901093
if CONFIG.HTTPS:
1091-
SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(CONFIG.SERVER_CERT,
1092-
CONFIG.SERVER_KEY,
1093-
CONFIG.CERT_CHAIN)
1094-
_https = " using SSL/TLS"
1094+
https = "using HTTPS"
1095+
# SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(
1096+
# config.SERVER_CERT, config.SERVER_KEY, config.CERT_CHAIN)
1097+
SRV.ssl_adapter = BuiltinSSLAdapter(CONFIG.SERVER_CERT,
1098+
CONFIG.SERVER_KEY,
1099+
CONFIG.CERT_CHAIN)
1100+
10951101
logger.info("Server starting")
10961102
print("IDP listening on %s:%s%s" % (HOST, PORT, _https))
10971103
try:

0 commit comments

Comments
 (0)