LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Trying to create a Certificate Signing Request with my Certification Authority (https://www.linuxquestions.org/questions/linux-security-4/trying-to-create-a-certificate-signing-request-with-my-certification-authority-4175601468/)

tsbah 03-10-2017 10:02 AM

Trying to create a Certificate Signing Request with my Certification Authority
 
I am trying to create a self-signed SSL certificate. It went OK until I tried to execute the following command:

openssl ca -config openssl-ca.cnf -policy signing_policy -extensions signing_req -out servercert.pem -infiles servercert.csr

In return I got the error messages below:

Using configuration from openssl-ca.cnf
Error Loading extension section signing_req
140254645262152:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('./index.txt.attr','rb')
140254645262152:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:172:
140254645262152:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:197:

Thanks for helping out

bathory 03-10-2017 04:17 PM

Hi and welcome to LQ,
Quote:

140254645262152:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('./index.txt.attr','rb')
You didn't say the procedure used to create you CA, but apparently you miss the index.txt.attr. You can use touch to create the file under the ~/CA directory. You should check openssl-ca.cnf for the correct CA directory location.

FYI you can use the following command to create a key/crt pair without the need of a CA:
Code:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem
Both key and crt are included in the resulting file, so you need to separate them in 2 files (like server.key and server.crt) and use the 2 files as needed.

Regards

tsbah 03-18-2017 02:39 PM

Hello bathory.

I am using LetsEncrypt. I have look in ~/ but there is no CA directory in there.
The certificate and key files are located in /etc/pki/tls/certs/ca.crt and /etc/pki/tls/private/ca.key.
That directory contains the following subdirectories:

- CA
- certs
- crl
- newcerts
- private
- ca-trust
- cyrus-imapd
- dovecot
- java
- kcare-gpg
- nssdb
- rpm-gpg
- rsyslog
- tls


I went ahead to touched index.txt.attr at the root of the CA directory

You write:

« FYI you can use the following command to create a key/crt pair without the need of a CA.»

Please not tht I am trying to get free https compliance for my website. That's what LetsEncrypt offers. But my configurations attemps haven't resulted to anything yet, for either my main website (http:/www.webafriqa.net) or the affiliated virtual domains.

I am on CentOS 6.8 running Apache 2.2.15 and Sendmail 8.14.4

Thanks

bathory 03-18-2017 06:12 PM

Quote:

You write:

« FYI you can use the following command to create a key/crt pair without the need of a CA.»

Please not tht I am trying to get free https compliance for my website. That's what LetsEncrypt offers. But my configurations attemps haven't resulted to anything yet, for either my main website (http:/www.webafriqa.net) or the affiliated virtual domains.
Huh, at your OP you said that you're trying to create a self-signed certificate and thus you had a CA problem

FYI, if you want to install a LetsEncrypt certificate, or any other commercial certificate, you don't need a CA. You have to create just the server key and a CSR based on that.

So use your favorite search engine to find a tutorial about using LetsEncrypt for apache on Centos (e.g this one)

Regards

tsbah 03-18-2017 07:51 PM

Thanks for the clarification and the link.

I'll keep you updated on the result of the LetsEncrypt self-signed certificate creation process.

tsbah 03-18-2017 08:49 PM

Quote:

Originally Posted by bathory (Post 5685336)
Huh, at your OP you said that you're trying to create a self-signed certificate and thus you had a CA problem

FYI, if you want to install a LetsEncrypt certificate, or any other commercial certificate, you don't need a CA. You have to create just the server key and a CSR based on that.

So use your favorite search engine to find a tutorial about using LetsEncrypt for apache on Centos (e.g this one)

Regards

Quote:

Originally Posted by tsbah (Post 5685364)
Thanks for the clarification and the link.

I'll keep you updated on the result of the LetsEncrypt self-signed certificate creation process.

I have now created the LetsEncrypt self-signed certificate.

Upon restarting httpd the browser displayed the Apache default home page. So, following the instructions I commented out the content of the file located at /etc/httpd/conf.d/welcome.conf.

I got my home page back. However, in the Apache default page the green padlock displayed neatly in the upper left corner of the browser.
That's not the case unfortunately with my real home page.

I run the test at https://www.ssllabs.com/ssltest/anal....webafriqa.net. It returned a B ratiing and an OK message for https://www.webafriqa.net.

I'd appreaciate if (a) you would run the same test and let me know what you think (b) indicate how to get the green padlock to display on my site.

Again, thanks a lot

bathory 03-19-2017 04:50 AM

Hi,

Just to clear things up a little.
A LetsEncrypt certificate is not self-signed. I haven't use one, but AFAIK it's a perfectly valid SSL certificate like the commercial ones, with the only difference that is free.

That said, I went to the link you've posted and I saw that your certificate is issued for the CN (CommonName that is the actual webserver name) "neene", that is different from your actual CN, that should be "www.webafriqa.net".
In fact going to your site with firefox and getting the cert, I can verify that it's issued for neene!!! and it's indeed self-signed. It's issued on Thu, 09 Mar 2017 (10 days ago) not its not signed by LetsEncrypt.

So most likely you're still using a self-signed cert created by you, and not the one issued by LetsEncrypt.

tsbah 03-19-2017 09:17 AM

Ok, I am going through Apache and LetsEncrypt configuration files (httpd.conf. ssl.conf) to try to fix the mismatch error and to standardize on www.webafriqa.net. The idea is to leave neene to host name designation.

Thanks


All times are GMT -5. The time now is 01:47 PM.