|
| 1 | +These files contain the Fedora Messaging credentials for the `/public_pubsub` |
| 2 | +endpoint. These credentials are well-known and part of the `fedora-messaging` |
| 3 | +package in Fedora. But the JMS Messaging plugin needs them in Java KeyStore |
| 4 | +format. This is a pain to do, so we just keep the resulting files in-tree. |
| 5 | + |
| 6 | +This also allows us to work around the lack of support for using Jenkins |
| 7 | +credentials in the JMS Messaging plugin: |
| 8 | + |
| 9 | +https://github.com/jenkinsci/jms-messaging-plugin/issues/263 |
| 10 | + |
| 11 | +To generate these files from the source ones, the following guide was used: |
| 12 | +https://docs.oracle.com/cd/E35976_01/server.740/es_admin/src/tadm_ssl_convert_pem_to_jks.html |
| 13 | + |
| 14 | +These steps are abbreviated below: |
| 15 | + |
| 16 | +### keystore.jks |
| 17 | + |
| 18 | +``` |
| 19 | +# convert fedora user and cert to PKCS12 |
| 20 | +openssl pkcs12 -export -in /etc/fedora-messaging/fedora-cert.pem -inkey /etc/fedora-messaging/fedora-key.pem -out fedora.p12 |
| 21 | +<use password 'fedora'> |
| 22 | +
|
| 23 | +# create a keystore jks |
| 24 | +keytool -genkey -keyalg RSA -alias foo -keystore keystore.jks |
| 25 | +# <use password 'fedora'> |
| 26 | +# <name values don't matter since we delete it right after> |
| 27 | +
|
| 28 | +# delete the key we just generated to empty it out |
| 29 | +keytool -delete -alias foo -keystore keystore.jks |
| 30 | +# <insert 'fedora' password> |
| 31 | +
|
| 32 | +# add PKCS12 creds to keystore |
| 33 | +keytool -v -importkeystore -srckeystore fedora.p12 -srcstoretype PKCS12 \ |
| 34 | + -destkeystore keystore.jks -deststoretype JKS |
| 35 | +``` |
| 36 | + |
| 37 | +### truststore.jks |
| 38 | + |
| 39 | +``` |
| 40 | +# create a new keystore jks |
| 41 | +keytool -genkey -keyalg RSA -alias foo -keystore truststore.jks |
| 42 | +# <use password 'fedora'> |
| 43 | +# <name values don't matter since we delete it right after> |
| 44 | +
|
| 45 | +# delete the key we just generated to empty it out |
| 46 | +keytool -delete -alias foo -keystore truststore.jks |
| 47 | +# <insert 'fedora' password> |
| 48 | +
|
| 49 | +# import the CA cert |
| 50 | +keytool -import -v -trustcacerts -alias cacerta -file /etc/fedora-messaging/cacert.pem -keystore truststore.jks |
| 51 | +# <say yes to trust question> |
| 52 | +``` |
0 commit comments