-
-
Notifications
You must be signed in to change notification settings - Fork 288
Unify two entrypoints #677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2232d9d
Unify two entrypoints
basil 12eabf0
Update src/main/java/hudson/remoting/Launcher.java
basil d490895
Update src/main/java/hudson/remoting/Launcher.java
basil 7875c0d
Stop using deprecated args
basil 01fee0f
Update src/main/java/hudson/remoting/Launcher.java
basil e4c9728
Continue to honor `proxyCredentials` Java system property
basil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -94,6 +94,8 @@ | |
| import org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException; | ||
| import org.jenkinsci.remoting.util.KeyUtils; | ||
| import org.jenkinsci.remoting.util.VersionNumber; | ||
| import org.kohsuke.accmod.Restricted; | ||
| import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
|
|
||
| /** | ||
| * Agent engine that proactively connects to Jenkins controller. | ||
|
|
@@ -169,7 +171,7 @@ public Thread newThread(@NonNull final Runnable r) { | |
| private String proxyCredentials = System.getProperty("proxyCredentials"); | ||
|
|
||
| /** | ||
| * See {@link hudson.remoting.jnlp.Main#tunnel} for the documentation. | ||
| * See {@link Launcher#tunnel} for the documentation. | ||
| */ | ||
| @CheckForNull | ||
| private String tunnel; | ||
|
|
@@ -885,7 +887,7 @@ private JnlpEndpointResolver createEndpointResolver(List<String> jenkinsUrls) { | |
| if (directConnection == null) { | ||
| SSLSocketFactory sslSocketFactory = null; | ||
| try { | ||
| sslSocketFactory = getSSLSocketFactory(); | ||
| sslSocketFactory = getSSLSocketFactory(candidateCertificates); | ||
| } catch (Exception e) { | ||
| events.error(e); | ||
| } | ||
|
|
@@ -1034,16 +1036,18 @@ private static FileInputStream getFileInputStream(final File file) throws Privil | |
| }); | ||
| } | ||
|
|
||
| private SSLSocketFactory getSSLSocketFactory() | ||
| @CheckForNull | ||
| @Restricted(NoExternalUse.class) | ||
| static SSLSocketFactory getSSLSocketFactory(List<X509Certificate> x509Certificates) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Widening the visibility of this method and making static so that it can be reused in another place where this same logic is needed. Also added a |
||
| throws PrivilegedActionException, KeyStoreException, NoSuchProviderException, CertificateException, | ||
| NoSuchAlgorithmException, IOException, KeyManagementException { | ||
| SSLSocketFactory sslSocketFactory = null; | ||
| if (candidateCertificates != null && !candidateCertificates.isEmpty()) { | ||
| if (x509Certificates != null && !x509Certificates.isEmpty()) { | ||
| KeyStore keyStore = getCacertsKeyStore(); | ||
| // load the keystore | ||
| keyStore.load(null, null); | ||
| int i = 0; | ||
| for (X509Certificate c : candidateCertificates) { | ||
| for (X509Certificate c : x509Certificates) { | ||
| keyStore.setCertificateEntry(String.format("alias-%d", i++), c); | ||
| } | ||
| // prepare the trust manager | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.