LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 01-03-2013, 10:03 AM   #1
Citadel
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Rep: Reputation: 0
Check all certs in ssl.conf


Hi all,

Not sure why this isn't working but I want to be able to check the expiry on a number of domains.

Code:
#!/bin/bash
for line in `grep SSLCertificateFile /etc/httpd/conf.d/ssl.conf|grep -v \#|awk '{print $2}'`
do
openssl x509 -in $line -text -noout |grep "Not After"
#echo $line;
done
The echo shows the correct path to the file and if I run the openssl command with that file path it works fine. The error I am getting is:

Code:
Error opening Certificate /etc/httpd/conf/ssl.crt/www.mydomain.com.crt
','r')error:02001002:system library:fopen:No such file or directory:bss_file.c:352:fopen('/etc/httpd/conf/ssl.crt/www.mydomain.com.crt
10756:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
unable to load certificate
 
Old 01-04-2013, 10:27 AM   #2
Citadel
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
My guess is that its grabbing the EOL character immediately after the path to the certificate. If I remove the character in the initial awk command it breaks because the EOL character of course says that the text is a line. If I try to remove the character afterwards it still complains.

Any thoughts?

Craig
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSL Certs on Squid citystriker Linux - Networking 1 07-15-2010 12:35 AM
Possible to use multiple SSL certs for same IP in Apache? jakev383 Linux - Server 3 09-03-2009 05:48 AM
SSL certs watcher69b Linux - Security 2 03-28-2009 10:34 AM
SSL certs/keys location BEBigBear Linux - Security 6 01-04-2009 09:03 AM
install 2 or more SSL certs on same machine with 1 IP lsimon4180 Linux - Software 0 10-22-2004 01:19 PM


All times are GMT -5. The time now is 06:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration