Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra space in openssl CLI output for notAfter/enddate #382

Closed
nikolaiderzhak opened this issue Jan 18, 2018 · 3 comments
Closed

Extra space in openssl CLI output for notAfter/enddate #382

nikolaiderzhak opened this issue Jan 18, 2018 · 3 comments

Comments

@nikolaiderzhak
Copy link

I am getting extra space in enddate output of this command:

$ export IP=google.com;  nc -z -w 3 $IP 443 && (echo | openssl s_client -connect $IP:443 2>/dev/null | openssl x509 -noout -enddate)
Connection to google.com port 443 [tcp/https] succeeded!
notAfter=Apr  4 09:40:00 2018 GMT

Note two spaces between Apr and 4 in notAfter= line.

That is the case for both versions I have on laptop and on linux server:

$ openssl version
LibreSSL 2.2.7
$ openssl version
OpenSSL 1.0.1f 6 Jan 2014

https://stackoverflow.com/questions/48328163/extra-space-in-openssl-cli-output-for-notafter-enddate

OpenSSL has the same issue: openssl/openssl#5107

@kinichiro
Copy link
Contributor

kinichiro commented Jan 19, 2018 via email

@4a6f656c
Copy link
Contributor

This is pretty much how dates work on Unix and C - the day is formatted as two digits with leading padding, hence a single digit day will be formatted as ' 4'. This is the same date(1) and ctime(3):

$ date -r 1516500000 
Sun Jan 21 13:00:00 AEDT 2018
$ date -r 1515000000 
Thu Jan  4 04:20:00 AEDT 2018

(Or date -d @1515000000 on a Linux system).

Is there a reason why you consider this to be a problem?

@nikolaiderzhak
Copy link
Author

nikolaiderzhak commented Jan 21, 2018

We using enddate string to confirm SSL certificate is taking care of and visually strings with one and two spaces looks the same while we get them different in process. Thank you for explanations !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants