Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

## Release 0.3.8 (NOT RELEASED YET)

* [Refactor Issue 291][issue-291]
* [JENKINS-46445](https://issues.jenkins-ci.org/browse/JENKINS-46445)

Add support for both client TLS and basic authentication.

```java
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setSslcontext(sslContext);
JenkinsHttpClient client = new JenkinsHttpClient(uri, builder, username, password);
JenkinsServer jenkins = new JenkinsServer(client);
```

* [Refactor Issue 291][issue-291]

Useful utility methods refactored into utility classes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,19 @@ public JenkinsHttpClient(URI uri) {
* @param password Password or auth token to use when connecting
*/
public JenkinsHttpClient(URI uri, String username, String password) {
this(uri, addAuthentication(HttpClientBuilder.create(), uri, username, password));
this(uri, HttpClientBuilder.create(), username, password);
}

/**
* Create an authenticated Jenkins HTTP client
*
* @param uri Location of the jenkins server (ex. http://localhost:8080)
* @param builder Configured HttpClientBuilder to be used
* @param username Username to use when connecting
* @param password Password or auth token to use when connecting
*/
public JenkinsHttpClient(URI uri, HttpClientBuilder builder, String username, String password) {
this(uri, addAuthentication(builder, uri, username, password));
if (isNotBlank(username)) {
localContext = new BasicHttpContext();
localContext.setAttribute("preemptive-auth", new BasicScheme());
Expand Down