Merge "Support testing nova-novncproxy on SSL"
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index 9587ffe..9110c4a 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -15,6 +15,7 @@
 
 import base64
 import socket
+import ssl
 import struct
 import textwrap
 
@@ -236,7 +237,11 @@
 
 def create_websocket(url):
     url = urlparse.urlparse(url)
-    client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    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))
     # Turn the Socket into a WebSocket to do the communication