简体   繁体   中英

Build job in Jenkins through python script SSL connection

I want to build a job in jenkins through python script.I am totally new to python.I am using below method from python-jenkins.my jenkins url is https.

 server = jenkins.Jenkins(ci_jenkins_url, username=username, password=token)

and i am getting

SSLError: HTTPSConnectionPool(host='{myjenkinsur}', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

how can I connect through SSL?

Try setting ssl_verifiy to False

server = jenkins.Jenkins(ci_jenkins_url, username=username, password=token, ssl_verify=False)

If you get error with the above command, then try the below one

server = jenkins.Jenkins(ci_jenkins_url, username=username, password=token)
server._session.verify = False

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM