Merge "Support testing nova-novncproxy on SSL"
This commit is contained in:
commit
192e64e66b
@ -15,6 +15,7 @@
|
||||
|
||||
import base64
|
||||
import socket
|
||||
import ssl
|
||||
import struct
|
||||
import textwrap
|
||||
|
||||
@ -236,6 +237,10 @@ def shelve_server(servers_client, server_id, force_shelve_offload=False):
|
||||
|
||||
def create_websocket(url):
|
||||
url = urlparse.urlparse(url)
|
||||
if url.scheme == 'https':
|
||||
client_socket = ssl.wrap_socket(socket.socket(socket.AF_INET,
|
||||
socket.SOCK_STREAM))
|
||||
else:
|
||||
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
client_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
client_socket.connect((url.hostname, url.port))
|
||||
|
Loading…
Reference in New Issue
Block a user