forked from vespa-engine/vespa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move setup of hosted specific 4443 connector to new class
- Loading branch information
Showing
2 changed files
with
39 additions
and
14 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
33 changes: 33 additions & 0 deletions
33
...del/src/main/java/com/yahoo/vespa/model/container/http/ssl/HostedSslConnectorFactory.java
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,33 @@ | ||
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
package com.yahoo.vespa.model.container.http.ssl; | ||
|
||
import com.yahoo.config.model.api.TlsSecrets; | ||
import com.yahoo.vespa.model.container.http.ConnectorFactory; | ||
|
||
/** | ||
* Component specification for {@link com.yahoo.jdisc.http.server.jetty.ConnectorFactory} with hosted specific configuration. | ||
* | ||
* @author bjorncs | ||
*/ | ||
public class HostedSslConnectorFactory extends ConnectorFactory { | ||
|
||
public HostedSslConnectorFactory(String serverName, TlsSecrets tlsSecrets) { | ||
this(serverName, tlsSecrets, null); | ||
} | ||
|
||
public HostedSslConnectorFactory(String serverName, TlsSecrets tlsSecrets, String tlsCaCertificates) { | ||
super("tls4443", 4443, createSslProvider(serverName, tlsSecrets, tlsCaCertificates)); | ||
} | ||
|
||
private static ConfiguredDirectSslProvider createSslProvider( | ||
String serverName, TlsSecrets tlsSecrets, String tlsCaCertificates) { | ||
return new ConfiguredDirectSslProvider( | ||
serverName, | ||
tlsSecrets.key(), | ||
tlsSecrets.certificate(), | ||
/*caCertificatePath*/null, | ||
tlsCaCertificates, | ||
"disabled"); | ||
} | ||
|
||
} |