@@ -84,12 +84,15 @@ public void setUp() throws Exception {
84
84
String tgtHostName = "test.openas2.org" ;
85
85
this .alias = tgtHostName ;
86
86
// Create the SSL file for the server to use
87
- String sslCertsFilePath = sslCertsFile .getAbsolutePath ();
87
+ // Switch to forward slash to avoid backslash being dropped when creating property string when on Windows
88
+ String sslCertsFilePath = sslCertsFile .getAbsolutePath ().replace ("\\ " , "/" );
88
89
this .certFx = genSelfSignedCert (alias , sslCertsFilePath , "RSA" , "SHA256" , 2048 , tgtHostName );
89
90
// Create the trust store with the public key so the certificate returned from the server is trusted
90
91
sslTrustCertsFile = Files .createFile (Paths .get (tmpDirAbsolutePath , "ssl_trust_certs.p12" )).toFile ();
92
+ // Switch to forward slash to avoid backslash being dropped when creating property string when on Windows
93
+ String sslTrustCertsFilePath = sslTrustCertsFile .getAbsolutePath ().replace ("\\ " , "/" );
91
94
String trustAlias = "trust-" + tgtHostName ;
92
- this .certFx .exportPublicKey (sslTrustCertsFile . getAbsolutePath () , this .alias , trustAlias , password );
95
+ this .certFx .exportPublicKey (sslTrustCertsFilePath , this .alias , trustAlias , password );
93
96
this .trustFx = new X509CertificateFactory ();
94
97
this .trustFx .setFilename (sslTrustCertsFile .getAbsolutePath ());
95
98
this .trustFx .setPassword (password );
@@ -99,6 +102,7 @@ public void setUp() throws Exception {
99
102
customPropsFile = Files .createFile (Paths .get (tmpDirAbsolutePath , "openas2.properties" )).toFile ();
100
103
System .setProperty (Properties .OPENAS2_PROPERTIES_FILE_PROP , customPropsFile .getAbsolutePath ());
101
104
FileOutputStream fos = new FileOutputStream (customPropsFile );
105
+ // Switch to forward slash to avoid backslash being dropped when creating property string when on Windows
102
106
fos .write (("ssl_keystore=" + sslCertsFilePath + "\n " ).getBytes ());
103
107
fos .write (("ssl_keystore_password=" + new String (password ) + "\n " ).getBytes ());
104
108
//fos.write(("ssl_trust_keystore=" + sslTrustCertsFile.getAbsolutePath() + "\n").getBytes());
0 commit comments