-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 default The 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: ``` <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>ServerFaultCode</faultcode> <faultstring>Cannot complete login due to an incorrect user name or password.</faultstring> <detail> <InvalidLoginFault xmlns="urn:vim25" xsi:type="InvalidLogin"> <faultMessage> <key>vim.fault.InvalidLoginWithReason</key> <arg> <key>1</key> <value xsi:type="xsd:string">vim.fault.InvalidLoginReasonRegisterFailed</value> </arg> <message>Login failed because the session could not be re-registered.</message> </faultMessage> </InvalidLoginFault> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> ``` 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
- Loading branch information
1 parent
0eea7ae
commit b44d8ae
Showing
6 changed files
with
96 additions
and
7 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
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
8 changes: 8 additions & 0 deletions
8
...urces/org/jenkinsci/plugins/vsphere/VSphereConnectionConfig/help-httpClientClassName.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,8 @@ | ||
<div> | ||
The <b>vSphere Cloud</b> plugin depends on | ||
<a href="https://github.com/yavijava/yavijava">yavijava</a> | ||
library, which supports two types of http clients: | ||
<a href="https://github.com/yavijava/yavijava/blob/gradle/src/main/java/com/vmware/vim25/ws/ApacheHttpClient.java">CloseableHttpClient</a> | ||
and | ||
<a href="https://github.com/yavijava/yavijava/blob/gradle/src/main/java/com/vmware/vim25/ws/WSClient.java">HttpURLConnection</a> | ||
</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