forked from morficus/Parameterized-Remote-Trigger-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to trust untrusted certificates
Added - A "NaiveTrustManager", which allows to bypass certificate checks -> Enables us to accept any certificate - TrustAllCertificates option for Jenkins Admins, adding new remote hosts to jenkins Refactored - Better error handling in RemoteJenkinsServer
- Loading branch information
1 parent
edc1287
commit 08ec3ec
Showing
6 changed files
with
150 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/org/jenkinsci/plugins/ParameterizedRemoteTrigger/utils/NaiveTrustManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils; | ||
|
||
import javax.net.ssl.*; | ||
import java.security.cert.X509Certificate; | ||
|
||
// Trust every server | ||
public class NaiveTrustManager implements X509TrustManager { | ||
@Override | ||
public void checkClientTrusted(X509Certificate[] arg0, String arg1) {} | ||
|
||
@Override | ||
public void checkServerTrusted(X509Certificate[] arg0, String arg1) {} | ||
|
||
@Override | ||
public X509Certificate[] getAcceptedIssuers() { | ||
return null; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...lugins/ParameterizedRemoteTrigger/RemoteBuildConfiguration/help-trustAllCertificates.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div> | ||
<div style="font-weight: bolder; text-decoration: underline"> | ||
Trust all certificates | ||
</div> | ||
|
||
<p> | ||
It is possible to override/rewrite the 'Trust all certificate'-setting for each Job separately. | ||
Setting this checkbox to 'true' will result in accepting all certificates for the given Job. | ||
</p> | ||
|
||
<div> | ||
If your remote Jenkins host has a | ||
<a href="https://en.wikipedia.org/wiki/Self-signed_certificate" target="_blank"> | ||
self-signed certificate | ||
</a> | ||
or its certificate is not trusted, you may want to enable this option. | ||
It will accept untrusted certificates for the given host. | ||
</div> | ||
|
||
<p><strong>This is unsafe and should only be used for testing or if you trust the host.</strong></p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...sci/plugins/ParameterizedRemoteTrigger/RemoteJenkinsServer/help-trustAllCertificates.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div> | ||
<div style="font-weight: bolder; text-decoration: underline"> | ||
Trust all certificates | ||
</div> | ||
|
||
<div> | ||
If your remote Jenkins host has a | ||
<a href="https://en.wikipedia.org/wiki/Self-signed_certificate" target="_blank"> | ||
self-signed certificate | ||
</a> | ||
or its certificate is not trusted, you may want to enable this option. | ||
It will accept untrusted certificates for the given host. | ||
</div> | ||
|
||
<p><strong>This is unsafe and should only be used for testing or if you trust the host.</strong></p> | ||
</div> |