Skip to content

Commit

Permalink
Support no hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe committed Oct 9, 2024
1 parent 9286ef8 commit d617fa8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,18 @@ public URL getUrl() throws MalformedURLException {
return new URL(https ? "https" : "http", host, port, "/jenkins/");
}

/**
* Sets up HTTPS for the current instance, and disables plain HTTP.
* This generates a self-signed certificate for localhost. The corresponding root CA that needs to be trusted by HTTP client can be obtained using {@link #getRootCA()}.
*
* @return the current instance
* @see #createWebClient()
*/
public RealJenkinsRule https() {
return https("localhost");
}


/**
* Sets up HTTPS for the current instance, and disables plain HTTP.
* This generates a self-signed certificate for the given host name. The corresponding root CA that needs to be trusted by HTTP client can be obtained using {@link #getRootCA()}.
Expand Down

0 comments on commit d617fa8

Please sign in to comment.