Sto provando a configurare un server Flask che utilizza un contesto OpenSSL. Tuttavia, poiché ho spostato lo script su un server diverso, continua a generare il seguente errore, non importa se sto usando Python 2.7 o 3.4 e non importa quale metodo SSL ho scelto (SSLv23/TLSv1/...):AttributeError: l'oggetto 'Context' non ha attributo 'wrap_socket'
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.4/dist-packages/werkzeug/serving.py", line 602, in inner
passthrough_errors, ssl_context).serve_forever()
File "/usr/local/lib/python3.4/dist-packages/werkzeug/serving.py", line 506, in make_server
passthrough_errors, ssl_context)
File "/usr/local/lib/python3.4/dist-packages/werkzeug/serving.py", line 450, in __init__
self.socket = ssl_context.wrap_socket(self.socket,
AttributeError: 'Context' object has no attribute 'wrap_socket'
Il codice secondo di seguito:
if __name__ == "__main__":
context = SSL.Context(SSL.SSLv23_METHOD)
context.use_privatekey_file('key.key')
context.use_certificate_file('cert.crt')
app.run(host='0.0.0.0', port=80, ssl_context=context, threaded=True, debug=True)
Grazie mille in anticipo! Sono felice per qualsiasi aiuto
È importante notare che l'ordine di 'crt' e' chiave' nella tupla 'contest'. –
Ottenere questo errore: l'oggetto '' tuple 'non ha attributo' wrap_socket'' – andrei