Help using OpenSSL to get a URL that's HTTPS with basic auth?

Hi Arduino lovers. Have been using Arduino for a long time and recently got myself a Yun that I'm trying to figure out. Unfortunately Python isn't in my skillset. What I'm trying to do, I think, is fairly simple:

Get the contents of:
https://www.fakesite.com/contents.txt
Using basic auth, and I have the username and password.

I know I can't use CURL from the Arduino side (as it doesn't support SSL) so I installed both the python-openSSL and pyopenSSL packages into the yun using the web interface but after HOURS of research can't seem to figure out the script to actually use Python OpenSSL to get that URL. :frowning:

Using Putty I can get the Yun to get the contents of a plain HTTP request so I know at least the WiFi part is working and things are relatively set up...

Any OpenSSL users who can help out? I would assume this would be few lines of code but maybe I'm missing something. OpenSSL's documentation is pretty hard for me to parse....

opkg update 
opkg install python-openssl
opkg install  nano
nano https.py
#!/usr/bin/python
import base64
import string
import httplib
auth = 'Basic ' + string.strip(base64.encodestring('userid'+ ':' + 'userpw'))
conn = httplib.HTTPSConnection("www.fakesite.com")
conn.putrequest("GET", "/full/path/and?query=whatever")
conn.putheader('Authorization', auth )
conn.endheaders() 
r = conn.getresponse()
print r.read()
chmod 755  https.py
./https.py

THANK YOU, sonnyyu! That's fantastic and I appreciate you taking the time to help me and others out!!