prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Websocket error: SSL not available 
  Getting this error when attempting to open a secure websocket ('wss://') using websocket-client.
  
  09-02 09:12:04.037 10328 10719 I python : [ERROR ] [MyApp] Websocket error: SSL not available.
  09-02 09:12:04.037 10328 10719 I python : [INFO ] [MyApp] Websocket closed
  
  Still happens after trying: 
  * buildozer android clean 
  * deleting the .buildozer directory and re-building
  * issuing `buildozer android update` and `buildozer android clean` and update
  
  buildozer requirements:
  
  requirements = kivy==1.10.0, sqlite3, openssl, pyopenssl, pygments, websocket-client
  
  Other notes:
  
  * To get websocket-client to load I had to copy websocket-client source locally into my project as recommended here:  https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/websocket-client/__init__.py#L3
  
  * I disabled the SSL check on websocket-client and found a lower level exception:
  
  09-02 10:00:43.215 13478 13511 I python : [ERROR ] [MyApp] Websocket error: _ssl.c:331: No root certificates specified for verification of other-side certificates.
  
  * SSL does work on my android build; elsewhere in our app we are successfully using https with urllib2. 
  
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pythonforandroid/recipes/websocket-client/__init__.py`
  Content:
  ```
  1 from pythonforandroid.toolchain import Recipe
  2 
  3 # if android app crashes on start with "ImportError: No module named websocket"
  4 #
  5 #     copy the 'websocket' directory into your app directory to force inclusion.
  6 #
  7 # see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe
  8 
  9 
  10 class WebSocketClient(Recipe):
  11 
  12     url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz'
  13 
  14     version = '0.40.0'
  15     # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986'
  16 
  17     # patches = ['websocket.patch']  # Paths relative to the recipe dir
  18 
  19     depends = ['kivy', 'python2', 'android', 'pyjnius',
  20                'cryptography', 'pyasn1', 'pyopenssl']
  21 
  22 recipe = WebSocketClient()
  23
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py
  --- a/pythonforandroid/recipes/websocket-client/__init__.py
  +++ b/pythonforandroid/recipes/websocket-client/__init__.py
  @@ -5,6 +5,12 @@
   #     copy the 'websocket' directory into your app directory to force inclusion.
   #
   # see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe
  +#
  +# If you see errors relating to 'SSL not available' ensure you have the package backports.ssl-match-hostname
  +# in the buildozer requirements, since Kivy targets python 2.7.x
  +#
  +# You may also need sslopt={"cert_reqs": ssl.CERT_NONE} as a parameter to ws.run_forever() if you get an error relating to
  +# host verification
   
   
   class WebSocketClient(Recipe):
  
verification_info: {"golden_diff": "diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py\n--- a/pythonforandroid/recipes/websocket-client/__init__.py\n+++ b/pythonforandroid/recipes/websocket-client/__init__.py\n@@ -5,6 +5,12 @@\n #     copy the 'websocket' directory into your app directory to force inclusion.\n #\n # see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe\n+#\n+# If you see errors relating to 'SSL not available' ensure you have the package backports.ssl-match-hostname\n+# in the buildozer requirements, since Kivy targets python 2.7.x\n+#\n+# You may also need sslopt={\"cert_reqs\": ssl.CERT_NONE} as a parameter to ws.run_forever() if you get an error relating to\n+# host verification\n \n \n class WebSocketClient(Recipe):\n", "issue": "Websocket error: SSL not available \nGetting this error when attempting to open a secure websocket ('wss://') using websocket-client.\r\n\r\n09-02 09:12:04.037 10328 10719 I python : [ERROR ] [MyApp] Websocket error: SSL not available.\r\n09-02 09:12:04.037 10328 10719 I python : [INFO ] [MyApp] Websocket closed\r\n\r\nStill happens after trying: \r\n* buildozer android clean \r\n* deleting the .buildozer directory and re-building\r\n* issuing `buildozer android update` and `buildozer android clean` and update\r\n\r\nbuildozer requirements:\r\n\r\nrequirements = kivy==1.10.0, sqlite3, openssl, pyopenssl, pygments, websocket-client\r\n\r\nOther notes:\r\n\r\n* To get websocket-client to load I had to copy websocket-client source locally into my project as recommended here:  https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/websocket-client/__init__.py#L3\r\n\r\n* I disabled the SSL check on websocket-client and found a lower level exception:\r\n\r\n09-02 10:00:43.215 13478 13511 I python : [ERROR ] [MyApp] Websocket error: _ssl.c:331: No root certificates specified for verification of other-side certificates.\r\n\r\n* SSL does work on my android build; elsewhere in our app we are successfully using https with urllib2. \r\n\r\n\r\n\n", "before_files": [{"content": "from pythonforandroid.toolchain import Recipe\n\n# if android app crashes on start with \"ImportError: No module named websocket\"\n#\n#     copy the 'websocket' directory into your app directory to force inclusion.\n#\n# see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe\n\n\nclass WebSocketClient(Recipe):\n\n    url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz'\n\n    version = '0.40.0'\n    # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986'\n\n    # patches = ['websocket.patch']  # Paths relative to the recipe dir\n\n    depends = ['kivy', 'python2', 'android', 'pyjnius',\n               'cryptography', 'pyasn1', 'pyopenssl']\n\nrecipe = WebSocketClient()\n", "path": "pythonforandroid/recipes/websocket-client/__init__.py"}], "after_files": [{"content": "from pythonforandroid.toolchain import Recipe\n\n# if android app crashes on start with \"ImportError: No module named websocket\"\n#\n#     copy the 'websocket' directory into your app directory to force inclusion.\n#\n# see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe\n#\n# If you see errors relating to 'SSL not available' ensure you have the package backports.ssl-match-hostname\n# in the buildozer requirements, since Kivy targets python 2.7.x\n#\n# You may also need sslopt={\"cert_reqs\": ssl.CERT_NONE} as a parameter to ws.run_forever() if you get an error relating to\n# host verification\n\n\nclass WebSocketClient(Recipe):\n\n    url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz'\n\n    version = '0.40.0'\n    # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986'\n\n    # patches = ['websocket.patch']  # Paths relative to the recipe dir\n\n    depends = ['kivy', 'python2', 'android', 'pyjnius',\n               'cryptography', 'pyasn1', 'pyopenssl']\n\nrecipe = WebSocketClient()\n", "path": "pythonforandroid/recipes/websocket-client/__init__.py"}]}