I am struggling to set up HTTPS for my graylog instance. Here are some basic infos about my setup and what I have done so far:
- OS:Ubuntu 18.04.1 LTS
- Version: 2.5.0+ed06ce7, codename Trippy Trampoline
- JVM: PID 9950, Oracle Corporation 1.8.0_191 on Linux 4.15.0-42-generic
Graylog is running fine with the default configuration using http over port 9000.
I now want to secure the connection with our companys own CA.
I’ve followed the section Converting a PKCS #12 (PFX) file to private key and certificate pair from here:
PKCS #12 key stores (PFX files) are commonly used on Microsoft Windows.
In this example, the PKCS #12 (PFX) file is named
keystore.pfx
:$ openssl pkcs12 -in keystore.pfx -nokeys -out graylog-certificate.pem $ openssl pkcs12 -in keystore.pfx -nocerts -out graylog-pkcs5.pem $ openssl pkcs8 -in graylog-pkcs5.pem -topk8 -out graylog-key.pem
The resulting
graylog-certificate.pem
andgraylog-key.pem
can be used in the Graylog configuration file.
For demonstrating purposes I’ve generated a new CA and issued a certificate for graylog so that I can post these here. When asked for a password I’ve always used secret. These are the two certificates created by the above commands:
Key:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIagKg9ARhyhwCAggA
MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBD7zmDKWPuI7auCjriheK/RBIIE
0LB5HEivJLmCHmwy9pGafbzTBXPJ/BBhDwKRA/YaSHk7NCT1kED87HEa1LX8y/pX
cOcqRyrVfmO3qywHxQYik3/qDq4lvF1c26nrGOk29fKG5qL9D5/huZOOqpDFXX1Y
hFS9hA7QuWgZE9275Nhsb2y+7L9HSSRnnD3xBFU2c+WAFRX3DnP9emt12ZJCobGY
SdCVmaRk6WwOo3af586lvlL233jeyZMSQXZEu4bXa3xvZWWR0lhlVvq7VPTX2Ycb
LLveFhmRCN8mgtHXTGv9ljKr1Mx0oP4NqbnX6524RKH/6tnXGr8jDveRGBFfhJeH
00NIIO4g2L7odtFcF0Ote+JzaDDtqJLNFVB/aNoARrJ+t7AOP3OFptljfhs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TEoF2GVqUpETfATsyCmZRYc4/M/wqYLyaaYAcNUJ
CWLQJegz7UnRMi4QZY9HwIWJxjAc1FVXKr5kQsSsOzHRc268FEv152q21p1KI/+1
klAanFyTOxuQwn/UbAVkf4sduPg54K4pqL/0tAbg2+8ljpqiZu9sGbJd7Hmo269M
z1vuS/lmMwcPfOnRkCauiWpZ8HVK/2LzXKwNYnjTVw/7
-----END ENCRYPTED PRIVATE KEY-----
Certificate:
Bag Attributes
localKeyID: CA E8 A6 0B 80 02 11 5C EC CB D9 95 5A BC EA 07 72 52 2F C7
friendlyName: graylog.domain.local
subject=/C=DE/ST=Baden-W\xC3\xBCrttemberg/L=DevTown/O=IT/OU=IT/CN=graylog.domain.local/emailAddress=no@response.me
issuer=/C=DE/ST=Baden-W\xC3\xBCrttemberg/L=DevTown/O=IT/OU=IT/CN=Development CA/emailAddress=no@response.me
-----BEGIN CERTIFICATE-----
MIIEVjCCAz6gAwIBAgIIWLiD/b9yv4gwDQYJKoZIhvcNAQELBQAwgY4xCzAJBgNV
BAYTAkRFMRswGQYDVQQIDBJCYWRlbi1Xw7xydHRlbWJlcmcxEDAOBgNVBAcTB0Rl
dlRvd24xCzAJBgNVBAoTAklUMQswCQYDVQQLEwJJVDEXMBUGA1UEAxMORGV2ZWxv
cG1lbnQgQ0ExHTAbBgkqhkiG9w0BCQEWDm5vQHJlc3BvbnNlLm1lMB4XDTE4MTIx
OTAwMDAwMFoXDTE5MTIxODIzNTk1OVowgZQxCzAJBgNVBAYTAkRFMRswGQYDVQQI
DBJCYWRlbi1Xw7xydHRlbWJlcmcxEDAOBgNVBAcTB0RldlRvd24xCzAJBgNVBAoT
AklUMQswCQYDVQQLEwJJVDEdMBsGA1UEAxMUZ3JheWxvZy5kb21haW4ubG9jYWwx
HTAbBgkqhkiG9w0BCQEWDm5vQHJlc3BvbnNlLm1lMIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAmeMCUIKROK/mcW8nZLTDHCSBVpeLFwY6kXkMbrGYvaC9
ZNS0IE4GjegLM8WUur9qtC9fA/P0lfTMtISb6QrRmKHvPJSUbCj0qh2R7a69/gOS
za5Vty1BQ+bOzVevNPq6e6QZ3Ig6yDwTidvhSRytdMobuTifIplcIqi8SczmqhIx
QtXAh1vloZZj3Aei8lwmlgDffS9oWWgMhPecSwpYhrOHHlCNquOHvQ/n3fkiNMS3
hwz3o5k2RKQF39T7FI8yHD7lAzEzG4nIkooJ5K+zFnG6i+3RSl4KC9SupsBVOgLi
bKAVs9xP9l1kX15791TJ7x0vtidszI8AlyZG+iSCPQIDAQABo4GvMIGsMAwGA1Ud
EwEB/wQCMAAwHQYDVR0OBBYEFGkKjM3OIIFc22TEwE8O8iwgzIa2MAsGA1UdDwQE
AwIF4DATBgNVHSUEDDAKBggrBgEFBQcDATAoBgNVHREEITAfghRncmF5bG9nLmRv
bWFpbi5sb2NhbIIHZ3JheWxvZzARBglghkgBhvhCAQEEBAMCBkAwHgYJYIZIAYb4
QgENBBEWD3hjYSBjZXJ0aWZpY2F0ZTANBgkqhkiG9w0BAQsFAAOCAQEAHECmquLo
b7wb2IrFhfb3M4AFlfbeUt/LXZrn3ESwiFpa1hAxTGBzeQVfAQnzHGCV/3iLQ3lp
P4paSEM2R8D+V67427RsCRPbeJKsAC3r0qFpdeX4RRzuUAHKhrxbGnDQ1ICVgT7V
2r785wisi4BHnOqHw7inmR/CDe7gfCHXop6PgXzuENC78dpVfh1feNXdxs3u6exC
LOSKSYCHoi/vYkd+yLslbRCYaeKBp4lIqmyF0wrToWr3foxw63TpLbX0CzEPRJj8
JVCdk5ApHu9f/pfiiyOd+1Cza5YUGNfAUqDC5g3H2MKwZQ9gGYCWHfcj4aF3z3T4
F4dFeVSwzIOxSA==
-----END CERTIFICATE-----
Bag Attributes:
subject=/C=DE/ST=Baden-W\xC3\xBCrttemberg/L=DevTown/O=IT/OU=IT/CN=Development CA/emailAddress=no@response.me
issuer=/C=DE/ST=Baden-W\xC3\xBCrttemberg/L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Yb4QgENBBEWD3hjYSBjZXJ0aWZp
Y2F0ZTANBgkqhkiG9w0BAQsFAAOCAQEAOHIJDPL0SJHJcv88hbBcWPE7k1wYUrYS
prLHxyPRHBza5ZznsoRJkt9l6O0MDMiYb/nN1sxFPLSQXgNRXbvV4slkPI9RXAFt
2I4EmoosZ5f6+ZCPDYYHfjlycx+M/xnR55xh9h+ihgAkJZQuNlcbmPG/BdaMJujM
p8n8GiudEOGAWmmvkPIzgvPqHJ9QVy5haZyPxF195UvS13W2YoFiOTm0z+wwDJPW
9izmx/sppP/C1s4KzwfBQC/VGJtCJJdXJu43Jauh5h5JjfhEO5bsAP+ctDxY1EeK
BXZjaN4L0FPAKon3ofonuw0N6gzXPdDe/g6JT//ZFPmTnlzHewyZEw==
-----END CERTIFICATE-----
I’ve set up my server.conf accordingly:
rest_listen_uri =
https://0.0.0.0:443/api/
rest_enable_tls = true
rest_tls_cert_file = /etc/ssl/graylog-certificate.pem
rest_tls_key_file = /etc/ssl/graylog-key.pem
rest_tls_key_password = network21
web_listen_uri =https://0.0.0.0:443/
web_enable_tls = true
web_tls_cert_file = /etc/ssl/graylog-certificate.pem
web_tls_key_file = /etc/ssl/graylog-key.pem
web_tls_key_password = network21
Unfortunately it seems like graylog is unable to read these certificate files properly:
2018-12-19T13:57:54.703+01:00 ERROR [ServerBootstrap] Graylog startup failed. Exiting. Exception was:
java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[JerseyService [FAILED]]}
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:741) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:553) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:314) ~[graylog.jar:?]
at org.graylog2.bootstrap.ServerBootstrap.startCommand(ServerBootstrap.java:149) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:209) [graylog.jar:?]
at org.graylog2.bootstrap.Main.main(Main.java:44) [graylog.jar:?]
Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: JerseyService [FAILED]
Caused by: java.io.IOException: ObjectIdentifier() – data isn’t an object ID (tag = 48)
at sun.security.util.ObjectIdentifier.(ObjectIdentifier.java:257) ~[?:1.8.0_191]
at sun.security.util.DerInputStream.getOID(DerInputStream.java:314) ~[?:1.8.0_191]
at com.sun.crypto.provider.PBES2Parameters.engineInit(PBES2Parameters.java:267) ~[sunjce_provider.jar:1.8.0_191]
at java.security.AlgorithmParameters.init(AlgorithmParameters.java:293) ~[?:1.8.0_191]
at sun.security.x509.AlgorithmId.decodeParams(AlgorithmId.java:132) ~[?:1.8.0_191]
at sun.security.x509.AlgorithmId.(AlgorithmId.java:114) ~[?:1.8.0_191]
at sun.security.x509.AlgorithmId.parse(AlgorithmId.java:372) ~[?:1.8.0_191]
at javax.crypto.EncryptedPrivateKeyInfo.(EncryptedPrivateKeyInfo.java:95) ~[?:1.8.0_191]
at org.graylog2.shared.security.tls.PemKeyStore.generateKeySpec(PemKeyStore.java:69) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.buildKeyStore(PemKeyStore.java:98) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.buildSslEngineConfigurator(JerseyService.java:384) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUpApi(JerseyService.java:207) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUp(JerseyService.java:141) ~[graylog.jar:?]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) ~[graylog.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:119) ~[graylog.jar:?]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_191]
2018-12-19T13:57:54.709+01:00 INFO [Server] SIGNAL received. Shutting down.
What am I missing here?
Certificates are not really my strong suit so any help is greatly appreciated!