Security

`How to Fix the below PEM routines:PEM_read_bio:bad end line error`

sgarvin55
Splunk Employee
Splunk Employee

ERROR SSLCommon - Can't read key file c:\program files\splunkuniversalforwarder\etc\certs\name.pem errno=151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line.

sgarvin55
Splunk Employee
Splunk Employee

This is most likely because the SSL certificate has been misconfigured.

Check your $SPLUNK_HOME\etc\certs\your_name.pem file. Look for a line that resembles the following:

-----END CERTIFICATE----------BEGIN CERTIFICATE-----

This can cause some serious issues because it cannot be interpreted, as you might have noticed.

How to Fix SSL PEM routines:PEM_read_bio:bad end line error

To fix this issue, use a text editor of choice and create a line break between the two files, i.e.

-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----

Tip: Count five hyphens at the start and end of the text.

You can now save the file and the error should be fixed!

kenoski
Path Finder

BTW,
This problem also occurs when you have a
-----END CERTIFICATE----------BEGIN RSA PRIVATE KEY-----
instead of
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----

but not if you have
-----END RSA PRIVATE KEY----------BEGIN CERTIFICATE-----

Seems formatting is inconsistently mandated when parsing.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...