Python Jira Connection With Proxy
I'm trying to connect via python-jira using a proxy: server = {'server': 'https://ip:port/jira', 'proxies': {'http': 'http://ip:port', 'https': 'http://ip:port'},
Solution 1:
You can provide the proxy to the constructor of JIRA:
cls.jira_object = JIRA(options=server,
basic_auth=(user, password),
validate=True,
proxies={"http": "http://ip:port", "https": "http://ip:port"})
Remember to remove the "proxies" from your options dict
More info about the constructor: https://github.com/pycontribs/jira/blob/develop/jira/client.py
Solution 2:
This worked for me in python3.
server = {'server': 'https://<jira.url.com>','proxies':"http://%s:%s@<ip>:<port>"%(proxy_user,proxy_password),'verify':True}
jira_object = JIRA(options=server,basic_auth=(jira_user,jira_password), validate=True)
Another option :
import os
from jira importJIRA
os.environ['https_proxy']='<proxy url>:<port>'
os.environ['http_proxy']='<proxy url>:<port>'
con = JIRA(basic_auth=(<username>,<password>),options={'server':'<jira_url>'})
Solution 3:
Easiest way is to set "HTTPS_PROXY" environment variable. I did it this way :
import osos.environ["HTTPS_PROXY"]="https://genproxy:8080"os.environ["HTTP_PROXY"]="http://ip:port"
Solution 4:
It seems like it requires bit of a magic. Have a look here at this answer.
Here's code:
my_jira = JIRA(jira_options, basic_auth=(jira_admin, jira_passwd))
my_jjira._session.proxies = {'http': '127.0.0.1:8888', 'https': '127.0.0.1:8888' }
Post a Comment for "Python Jira Connection With Proxy"