# SSL (https:) access from script

**URL:** <https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045>\
**Category:** Ignition\
**Created:** [August 22, 2012, 7:39pm UTC](https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045 "2012-08-22T19:39:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixso](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nixso](https://forum.inductiveautomation.com/u/nixso)\
**Post date:** [August 22, 2012, 7:39pm UTC](https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045/1 "2012-08-22T19:39:26Z")

</div>

Hello All…  
I need to script access to a web page (https://) via Jython (at least, I guess that’s the best way) from within Ignition. I’ve had success externally using the urllib2 module (v2.6+ Python) but does not work within Ignition (v2.5 Jy/Python). Is there another way to ‘get there’? I need to authenticate basic and use a cert to access the site.

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [August 22, 2012, 11:59pm UTC](https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045/2 "2012-08-22T23:59:39Z")

</div>

You can import the urllib2 in Ignition, Can you send in the error you are getting? You can either post it here or email it into us at [support@inductiveautomation.com](mailto:support@inductiveautomation.com) (make sure to hide the username/password). That way we can figure out where exactly the problem is coming from.

---

<div class="post-metadata">

**Author:** ![moralesm](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@moralesm](https://forum.inductiveautomation.com/u/moralesm)\
**Post date:** [November 7, 2012, 6:53am UTC](https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045/3 "2012-11-07T06:53:24Z")

</div>

Hello,  
Was this ever answered? I am getting the following error from a simple button test. My test position is that it works manually from IE on the same pc running the designer and python 2.7.

urllib2.URLError: \<urlopen error (10061, ‘Connection refused’)\>

script

import urllib2  
import base64

request = urllib2.Request(‘[https://url](https://url)….’)  
base64string = base64.encodestring(’%s:%s’ % (‘username’, ‘password’))  
request.add\_header(“Authorization”, “Basic %s” % base64string)  
result = urllib2.urlopen(request)  
print result.read()

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 8, 2012, 4:12pm UTC](https://forum.inductiveautomation.com/t/ssl-https-access-from-script/5045/4 "2012-11-08T16:12:53Z")

</div>

Most likely you set a proxy in IE so your script can’t really connect to the internet. I think you need to do something like this:`h = urllib.urlopen(website, proxies = {'http': proxy})`
