Skip to content

Commit

Permalink
Use workdir prefix for paths of certs
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Apr 23, 2018
1 parent 68029a8 commit 832dc92
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/net/consensys/orion/api/cmd/Orion.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ public void run(PrintStream out, PrintStream err, Config config) {
options.setClientAuth(ClientAuth.REQUIRED);

PemKeyCertOptions pemKeyCertOptions =
new PemKeyCertOptions().setKeyPath(config.tlsServerKey().toString()).setCertPath(
config.tlsServerCert().toString());
new PemKeyCertOptions().setKeyPath(config.workDir().resolve(config.tlsServerKey()).toString()).setCertPath(
config.workDir().resolve(config.tlsServerCert()).toString());
options.setPemKeyCertOptions(pemKeyCertOptions);


Expand All @@ -308,10 +308,13 @@ public void run(PrintStream out, PrintStream err, Config config) {

tmfCreator.ifPresent(tmf -> {
try {
HostFingerprintRepository hostFingerprintRepository = new HostFingerprintRepository(config.tlsKnownClients());
HostFingerprintRepository hostFingerprintRepository =
new HostFingerprintRepository(config.workDir().resolve(config.tlsKnownClients()));
options.setTrustOptions(new TrustManagerFactoryWrapper(tmf.apply(hostFingerprintRepository)));
} catch (IOException e) {
throw new OrionStartException("Could not read the contents of " + config.tlsKnownClients(), e);
throw new OrionStartException(
"Could not read the contents of " + config.workDir().resolve(config.tlsKnownClients()),
e);
}
});
}
Expand Down

0 comments on commit 832dc92

Please sign in to comment.