Virtualenv is suddenly broken on MacOS – SSL module is not available

After a while, maybe one year after I install virtualenv on my Mac, there is an error when I run a python script in virtual environment:

Could not fetch URL ... : There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping

After researching on Google, finally I found this solution:

brew switch openssl 1.0.2j

Hope that it would work for you too.