2016-12-14 229 views
1

首先,我對證書的接觸和經驗有限,所以我嘗試將此用作學習體驗以及獲得答案。Jenkins和SSL證書

使用Jenkins我希望能夠使用證書(.p12)進行身份驗證,作爲我的構建的一部分發出curl請求。

curl --cert /Users/Jenkins/.jenkins/workspace/develop-pipeline/../certificates/dev_cert.p12:password https://jira.dev.organisation.co.uk:443/rest/api/2/issue/MYSTATS-1234 

所以,我有我已經保存到哪裏詹金斯運行本機桌面證書(私鑰),但我也明白,我需要一個CA證書,授權該私鑰(希望迄今爲止這是正確的)。

當我從Jenkins機器上的終端運行curl命令時,我有一個彈出窗口,詢問我是否想使用鑰匙串內的證書進行授權,並且我單擊始終允許,因此命令行卷曲請求始終可用。

然而,當我運行此作爲詹金斯構建的一部分,我得到

(58) SSL: Can't load the certificate "/Users/Jenkins/.jenkins/workspace/develop-pipeline/../certificates/dev_cert.p12" and its private key: OSStatus -25308 

到證書的路徑是正確的,因爲該目錄結構

develop-pipeline 
certificates 
    dev_cert.p12 

什麼我不明白的是,如果我沒有提供密碼

curl --cert /Users/Jenkins/.jenkins/workspace/develop-pipeline/../certificates/dev_cert.p12 https://jira.dev.organisation.co.uk:443/rest/api/2/issue/MYSTATS-1234 

我收到消息

SSL The certificate "/Users/Jenkins/.jenkins/workspace/develop-pipeline/dev_cert.p12" requires a password 

那麼它找到了證書?

也提供了一個不正確的密碼產量

SSL: Incorrect password for the certificate "/Users/Jenkins/.jenkins/workspace/develop-pipeline/dev_cert.p12" and its private key. 

什麼我需要做的就是這個工作?對事物的任何鏈接,這將有助於我

感謝

回答

1

This Github comment幫我整理出上OSX捲曲問題。所以在我的情況下安裝捲曲通過Homebrew與OpenSSL標誌做了伎倆。