SSLError: wrong version number

Hi, My name is Andrew and I’m currently working on integrating shotgun to our automation tools. Everything is running nicely until recently we encountered a rather peculiar problem as the console shown below whenever we try to query a task from shotgun server (using shotgun.find method).

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2622)

The problem seems to occur randomly. Sometimes the code will run fine and the query shows up but on the next or other occasion the error will pop-up then crashed the entire code.

We’ve been looking everywhere and sounds its a problem with mismatched openssl version between the client and the server. However, we’ve got no definitive solution to fix the problem. Perhaps if anyone has ever encountered such kind of error or has any idea on why it happens randomly can share their solution. Thank you.

1 Like

It is not entirely clear how your setup is organized, and in what context it runs.
Where is openssl coming from? There was the TLS version switch a while ago in Shotgun, there must be a document describing how to upgrade your system.

1 Like

Hi mmoshev, thank you for your reply. My setup is using shotgun python API and the error occurred during find or find_one method of the API. At the moment I will try to see about the TLS version switch you have mentioned. Thank you for your input. Cheers.

Which python version do you use? Is it a normal installation?

Here is the article: Insecure HTTPS and Old Toolkit Core Deprecation - May 15th, 2019 – Shotgun Support

You need certain versions of programs to support this.

Hi mmoshev, thank you for the article. I’m reading it at the moment.

We are currently using python 3.8.5 (32 bit) and it is a normal installation from python.org.

At the moment (due to studio tight schedule and the high importance for the code within the pipeline), I’ve disabled the SSL validation using:

shotgun_api3.shotgun. NO_SSL_VALIDATION = True

We felt that this is only a temporary solution. Therefore, we will look over the article you’ve provided and find more permanent solution. Thank you so much for your help so far.

Oh okay, if you are using such a new python it would be a different cause, then.

A quick search on Stack Overflow suggests either

  • you are not passing the https:// protocol part in the url
  • you are using a wrong port
  • proxy is terminating ssl
  • certificates are not properly set up

I suppose you are using latest versions of sg api & toolkit?

1 Like