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.
The plugin depends on network library yavijava
https://github.com/jenkinsci/vsphere-cloud-plugin/blob/master/pom.xml#L95-L96
The yavijava supports two types of http clients:
CloseableHttpClient
HttpURLConnection
- is defaultThe HttpURLConnection client's behaviour can be impacted by system-wide cookie handler CookieManager:
https://docs.oracle.com/javase/8/docs/api/java/net/CookieManager.html The major problem is that the CookieManager overlaps logic provided by HttpURLConnection to setup http header
Cookie
. Global CookieManager know nothing about logic of vsphere-cloud-plugin and fill all http headers with stored cookies, as result vsphere center rejects login requests with error:The vsphere-cloud-plugin does not use CookieManager, but there is no guarantee that other plugins avoid it. Example:
https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ParameterizedRemoteTrigger/RemoteBuildConfiguration.java#L158-L159
As workaroud we can switch to CloseableHttpClient http client.
Issue in Jira:
https://issues.jenkins.io/browse/JENKINS-69999