LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-10-2017, 10:02 AM   #1
tsbah
LQ Newbie
 
Registered: Mar 2017
Location: USA
Distribution: CentOS
Posts: 5

Rep: Reputation: Disabled
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 routinesEF_LOAD:no such file:conf_def.c:197:

Thanks for helping out
 
Old 03-10-2017, 04:17 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,826

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
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
 
Old 03-18-2017, 02:39 PM   #3
tsbah
LQ Newbie
 
Registered: Mar 2017
Location: USA
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-18-2017, 06:12 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,826

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
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
 
Old 03-18-2017, 07:51 PM   #5
tsbah
LQ Newbie
 
Registered: Mar 2017
Location: USA
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the clarification and the link.

I'll keep you updated on the result of the LetsEncrypt self-signed certificate creation process.
 
Old 03-18-2017, 08:49 PM   #6
tsbah
LQ Newbie
 
Registered: Mar 2017
Location: USA
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
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 View Post
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
 
Old 03-19-2017, 04:50 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,826

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
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.
 
Old 03-19-2017, 09:17 AM   #8
tsbah
LQ Newbie
 
Registered: Mar 2017
Location: USA
Distribution: CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Certificate Authority on Linux Mint techdude Linux - Software 5 09-02-2014 09:40 PM
How can we implement a CA(certificate authority) in linux(Which distribution better?) jeremy28 Linux - Security 2 04-24-2010 05:47 PM
LXer: Setting up your own certificate authority with gnoMint LXer Syndicated Linux News 0 09-30-2008 06:10 PM
sendmail and Certificate Authority fatra2 Linux - Security 8 03-27-2008 09:18 AM
create a new certificate request SSL Debian Linux xxsubz78x Debian 8 12-09-2007 05:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration