Mercurial > p > roundup > code
comparison scripts/oauth-get-token.py @ 7108:b26207712c2b
Use an ssl.SSLContext instead of ssl.wrap_socket
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Thu, 08 Dec 2022 11:17:07 +0100 |
| parents | 8cda8e05c9a0 |
| children | 0597120e0a74 |
comparison
equal
deleted
inserted
replaced
| 7090:8cda8e05c9a0 | 7108:b26207712c2b |
|---|---|
| 147 | 147 |
| 148 port = self.args.https_server_port | 148 port = self.args.https_server_port |
| 149 httpd = HTTPServer (('localhost', port), RQ_Handler) | 149 httpd = HTTPServer (('localhost', port), RQ_Handler) |
| 150 | 150 |
| 151 if self.use_tls: | 151 if self.use_tls: |
| 152 httpd.socket = ssl.wrap_socket \ | 152 context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) |
| 153 ( httpd.socket | 153 context.load_cert_chain \ |
| 154 , keyfile = self.args.keyfile | 154 ( keyfile = self.args.keyfile |
| 155 , certfile = self.args.certfile | 155 , certfile = self.args.certfile |
| 156 , server_side = True | |
| 157 ) | 156 ) |
| 158 | 157 httpd.socket = context.wrap_socket \ |
| 158 (httpd.socket, server_side = True) | |
| 159 while not self.request_received: | 159 while not self.request_received: |
| 160 httpd.handle_request () | 160 httpd.handle_request () |
| 161 # end def https_server | 161 # end def https_server |
| 162 | 162 |
| 163 # end class Request_Token | 163 # end class Request_Token |
