ppalaga commented on code in PR #5485:
URL: https://github.com/apache/camel-quarkus/pull/5485#discussion_r1384604299


##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/README.adoc:
##########
@@ -16,4 +16,50 @@ We test in two ways how the SOAP service endpoints are 
deployed: the Camel way a
 * The service method then forwards to a Camel route defined in 
`WsSecurityPolicyServerRoutesCxfWay`
 * See also `WssSecurityPolicyHelloServiceCxfWayImpl`
 * This way may come in handy in situations when the Camel way does not work 
properly,
-  such as https://github.com/apache/camel-quarkus/issues/4291
\ No newline at end of file
+  such as https://github.com/apache/camel-quarkus/issues/4291
+
+= FIPS
+
+Please use profile `fips` if running the tests in the FIPS-enabled 
environment. The tests have to leverage BouncyCastle-fips dependency instead of 
standard BouncyCastle.
+
+= Generating keystores
+
+=== Generate keys
+
+```
+openssl genrsa -out alice.key 2048
+openssl genrsa -out bob.key 2048
+```
+
+=== Certificate authority
+
+When prompted for certificate information, confirm default values.
+```
+openssl genrsa -out cxfca.key 2048
+openssl req -x509 -new -key cxfca.key -nodes -out cxfca.pem -config 
cxfca-openssl.cnf -days 3650 -extensions v3_req
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+```
+
+=== Generate certificates
+```
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=alice' 
-key alice.key -out alice.csr
+openssl x509 -req -in alice.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out alice.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=bob' -key 
bob.key -out bob.csr
+openssl x509 -req -in bob.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out bob.crt
+```
+
+=== Export keystores
+
+When prompted for password, type `password`.
+When prompted whether to trust the certificate, type `yes`.
+
+```
+openssl pkcs12 -export -in alice.crt -inkey alice.key -certfile cxfca.crt 
-name "alice" -out alice.p12 -passout pass:password -keypbe aes-256-cbc 
-certpbe aes-256-cbc
+openssl pkcs12 -export -in bob.crt -inkey bob.key -certfile cxfca.crt -name 
"bob" -out bob.p12 -passout pass:password -keypbe aes-256-cbc -certpbe 
aes-256-cbc
+
+keytool -import -trustcacerts -alias bob -file bob.crt -keystore alice.p12
+keytool -import -trustcacerts -alias alice -file alice.crt -keystore bob.p12

Review Comment:
   ```suggestion
   ```
   
   This won't work based on the info from https://stackoverflow.com/a/50398011 
   It is also not necessary because we do `openssl pkcs12 -export ... -out 
alice.p12` (and the same for Bob) above.
   



##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/README.adoc:
##########
@@ -16,4 +16,50 @@ We test in two ways how the SOAP service endpoints are 
deployed: the Camel way a
 * The service method then forwards to a Camel route defined in 
`WsSecurityPolicyServerRoutesCxfWay`
 * See also `WssSecurityPolicyHelloServiceCxfWayImpl`
 * This way may come in handy in situations when the Camel way does not work 
properly,
-  such as https://github.com/apache/camel-quarkus/issues/4291
\ No newline at end of file
+  such as https://github.com/apache/camel-quarkus/issues/4291
+
+= FIPS
+
+Please use profile `fips` if running the tests in the FIPS-enabled 
environment. The tests have to leverage BouncyCastle-fips dependency instead of 
standard BouncyCastle.
+
+= Generating keystores
+
+=== Generate keys
+
+```
+openssl genrsa -out alice.key 2048
+openssl genrsa -out bob.key 2048
+```
+
+=== Certificate authority
+
+When prompted for certificate information, confirm default values.
+```
+openssl genrsa -out cxfca.key 2048
+openssl req -x509 -new -key cxfca.key -nodes -out cxfca.pem -config 
cxfca-openssl.cnf -days 3650 -extensions v3_req
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+```
+
+=== Generate certificates
+```
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=alice' 
-key alice.key -out alice.csr
+openssl x509 -req -in alice.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out alice.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=bob' -key 
bob.key -out bob.csr
+openssl x509 -req -in bob.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out bob.crt
+```

Review Comment:
   Could you please have a look what is the validity duration of the generated 
certs? If it is something relatively short like a couple of weeks or moths, I'd 
vote for increasing it to something reasonably long (20 years?) so that we do 
not have to regen them too often. What do others think?



##########
integration-test-groups/cxf-soap/cxf-soap-ws-security-server/README.adoc:
##########
@@ -16,4 +16,50 @@ We test in two ways how the SOAP service endpoints are 
deployed: the Camel way a
 * The service method then forwards to a Camel route defined in 
`WsSecurityPolicyServerRoutesCxfWay`
 * See also `WssSecurityPolicyHelloServiceCxfWayImpl`
 * This way may come in handy in situations when the Camel way does not work 
properly,
-  such as https://github.com/apache/camel-quarkus/issues/4291
\ No newline at end of file
+  such as https://github.com/apache/camel-quarkus/issues/4291
+
+= FIPS
+
+Please use profile `fips` if running the tests in the FIPS-enabled 
environment. The tests have to leverage BouncyCastle-fips dependency instead of 
standard BouncyCastle.
+
+= Generating keystores
+
+=== Generate keys
+
+```
+openssl genrsa -out alice.key 2048
+openssl genrsa -out bob.key 2048
+```
+
+=== Certificate authority
+
+When prompted for certificate information, confirm default values.
+```
+openssl genrsa -out cxfca.key 2048
+openssl req -x509 -new -key cxfca.key -nodes -out cxfca.pem -config 
cxfca-openssl.cnf -days 3650 -extensions v3_req
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+```
+
+=== Generate certificates
+```
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=cxfca' 
-x509 -key cxfca.key -out cxfca.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=alice' 
-key alice.key -out alice.csr
+openssl x509 -req -in alice.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out alice.crt
+
+openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=bob' -key 
bob.key -out bob.csr
+openssl x509 -req -in bob.csr -CA cxfca.pem -CAkey cxfca.key -CAcreateserial 
-out bob.crt
+```
+
+=== Export keystores
+
+When prompted for password, type `password`.
+When prompted whether to trust the certificate, type `yes`.
+
+```
+openssl pkcs12 -export -in alice.crt -inkey alice.key -certfile cxfca.crt 
-name "alice" -out alice.p12 -passout pass:password -keypbe aes-256-cbc 
-certpbe aes-256-cbc
+openssl pkcs12 -export -in bob.crt -inkey bob.key -certfile cxfca.crt -name 
"bob" -out bob.p12 -passout pass:password -keypbe aes-256-cbc -certpbe 
aes-256-cbc
+
+keytool -import -trustcacerts -alias bob -file bob.crt -keystore alice.p12
+keytool -import -trustcacerts -alias alice -file alice.crt -keystore bob.p12

Review Comment:
   I'd prefer having a single runnable shell script so that it is easier to 
check whether it works and so that it is easier to copy it to Quarkus CXF :-) 
The comments can be moved there too. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to