api4jenkins
api4jenkins copied to clipboard
SSL check false
Hi, I got following error, have anything else parameters to false check certificates?
Max retries exceeded with url: /crumbIssuer/api/json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
have you set correct Jenkins URL in system configuration ?
@joelee2012 I am sure system configuration is right. In addition i adopt to invoke from jenkinsapi.jenkins import Jenkins
as long as False SSL check is work fine. So i wanna to know api4jenkins
have anything else possible to do same configuration? Thanks you
yes, it does, any parameter supported by requests can be used to init Jenkins
, see : https://api4jenkins.readthedocs.io/en/latest/user/example.html#jenkins, example to disable ssl verify:
from api4jenkins import Jenkins
client = Jenkins('http://127.0.0.1:8080/', auth=('username', 'password or token'), verify=False)
Hi @joelee2012, Thanks for you reply i will try it.
I will feedback here. Exactly when added the "verify=False" it's would be fine.
@joelee2012 in addition. I try to use "job.build" to build with parameters. Have anything possible through the **parameters to do?
par = [
"TEST_TARGET=rm-sit3",
"TEST_NAME=ReturnSitTests",
"USERS_NUMBER=1",
"TENANT=rm-sit3-02",
"SLACK_SEND=true"
]
"""
job.build(arg1='string1', arg2='string2')
"""
job.build(
*par
)
yes, use dict, here is code snippet
parameters = {'arg1': 'values', 'args': 'value2'}
job.build(**parameters)
, verify=False
Hello,
Works fine but still have warnings. Is it possible to remove them ?
connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host 'xxxxxxxxxx'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn( connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host 'xxxxxxxxxxx'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn(
the warning tells the answer https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings , add snippet before your code
import urllib3
urllib3.disable_warnings()