windows - Curl arbejder ikke i Jenkins job

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg forsøger at udløse et fjerntliggende Jenkins job fra en vært Jenkins server.


Jeg har oprettet byggetegn. Jeg forsøger at ringe til jobbet ved hjælp af krøllen


curl.exe -v -x -K --insecure -u "username@username.com:pwd" POST https://hostname:8443/job/mypackjob/build?token=XXXIODFASDF


hvis du bruger den samme kommando fra kommandoprompten (dvs. Windows CMD), bliver jobbet udløst, men fra Jenkins job fungerer det ikke. Jeg får HTTP/1.1 fejl.


* Rebuilt URL to: POST/
  \% Total    \% Received \% Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Could not resolve host: POST
* Closing connection 0
curl: (6) Could not resolve host: POST

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 132.186.32.5...
* TCP\_NODELAY set
* Connected to INCHNIISNW0113.net (132.186.32.5) port 8443 (#1)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.2 (IN), TLS handshake, Server hello (2):
{ [85 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [1580 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [333 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [70 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
{ [1 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=INCHNIISNW0113.net
*  start date: Nov  3 13:41:11 2016 GMT
*  expire date: Dec 31 23:59:59 2039 GMT
*  issuer: CN=API
*  SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
* Server auth using Basic with user 'username@xxx.com'
} [5 bytes data]
> -K /job/2.50HR0API0Obfuscation/build?token=TRIGGERMEHRAPIBUILD HTTP/1.0

> Host: INCHNIISNW0113.net:8443

> Authorization: Basic **************

> User-Agent: curl/7.58.0

> Accept: */*

> 


  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0{ [5 bytes data]
**< HTTP/1.1 404 Not Found**

< Date: Wed, 18 Apr 2018 15:46:23 GMT

< X-Content-Type-Options: nosniff

< Server: Jetty(9.4.z-SNAPSHOT)

* no chunk, no close, no size. Assume close to signal end
< 


  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0{ [5 bytes data]
* TLSv1.2 (IN), TLS alert, Client hello (1):
{ [2 bytes data]

  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
* Closing connection 1
} [5 bytes data]
* TLSv1.2 (OUT), TLS alert, Client hello (1):
} [2 bytes data]

Bedste reference