Skip to content

Commit

Permalink
Merge pull request #21295 from famod/fix-both-random-ports
Browse files Browse the repository at this point in the history
Fix IllegalArgumentException in rest-assured if http and https ports are both random
  • Loading branch information
geoand authored Nov 9, 2021
2 parents bbe806e + f81a64c commit e869680
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ private static HttpServerOptions createSslOptions(HttpBuildTimeConfig buildTimeC
serverOptions.setSni(sslConfig.sni);
serverOptions.setHost(httpConfiguration.host);
int sslPort = httpConfiguration.determineSslPort(launchMode);
serverOptions.setPort(sslPort == 0 ? -1 : sslPort);
// -2 instead of -1 (see http) to have vert.x assign two different random ports if both http and https shall be random
serverOptions.setPort(sslPort == 0 ? -2 : sslPort);
serverOptions.setClientAuth(buildTimeConfig.tlsClientAuth);
serverOptions.setReusePort(httpConfiguration.soReusePort);
serverOptions.setTcpQuickAck(httpConfiguration.tcpQuickAck);
Expand Down

0 comments on commit e869680

Please sign in to comment.