Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-01-2006, 06:24 PM
|
#1
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Rep:
|
Issue With modSSL
I have the mod installed and it is running, however firefox gives me an error when i try to load my homepage in HTTPS... the access_log gives no error and heres a snippet of the ssl_engine_log:
Code:
[01/Feb/2006 19:34:18 07650] [info] Server: Apache/1.3.33, Interface: mod_ssl/2.8.24, Library: OpenSSL/0.9.7g
[01/Feb/2006 19:34:18 07650] [info] Init: 1st startup round (still not detached)
[01/Feb/2006 19:34:18 07650] [info] Init: Initializing OpenSSL library
[01/Feb/2006 19:34:18 07650] [info] Init: Seeding PRNG with 136 bytes of entropy
[01/Feb/2006 19:34:18 07650] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[01/Feb/2006 19:34:18 07650] [info] Init: Configuring temporary DH parameters (512/1024 bits)
[01/Feb/2006 19:34:28 07652] [info] Server: Apache/1.3.33, Interface: mod_ssl/2.8.24, Library: OpenSSL/0.9.7g
[01/Feb/2006 19:34:28 07652] [info] Init: 1st startup round (still not detached)
[01/Feb/2006 19:34:28 07652] [info] Init: Initializing OpenSSL library
[01/Feb/2006 19:34:28 07652] [info] Init: Loading certificate & private key of SSL-aware server new.host.name:443
[01/Feb/2006 19:34:28 07652] [error] Init: Unable to read server certificate from file /etc/apache/ssl.crt/server.crt (OpenSSL library error follows)
[01/Feb/2006 19:34:28 07652] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data
|
|
|
02-01-2006, 07:02 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
Did you generate keys/certificates for the server? One of the error messages says it's generating its own temporary keys. The last 2 lines look like it wasn't able to generate the keys due to a lack of entropy.
|
|
|
02-01-2006, 07:05 PM
|
#3
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
i did the full install of 10.2... theres a bunch of folders pertaining to SSL in the apache folder including the file: server.crt
|
|
|
02-02-2006, 02:47 AM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
According to the README.crt file in the same directory as server.crt (installed by mod_ssl-2.8.24_1.3.33-i486-1) that is a dummy file that "may be overwritten by the `make certificate' target under built-time". What do you get if you type `cat /etc/apache/ssl.crt/server.crt`? (I'm assuming you've installed the package to the default location)
|
|
|
02-02-2006, 04:53 PM
|
#5
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
lol it says:
THIS FILE HAS TO BE REPLACED BY A REAL SERVER CERTIFICATE! (SKIPME)
so how do i make a cert?
i tried:
openssl req -new -key privkey.pem -out cert.csr
but it says it cant find the private key
Last edited by scrupul0us; 02-02-2006 at 04:59 PM.
|
|
|
02-02-2006, 05:33 PM
|
#6
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
That's right - you have to have the key first. If you want self-signed certs you can do something like:
Code:
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -x509 -days 365 -out server.crt
If you want to get a cert signed by a certificate authority, have a look at http://www.modssl.org/related/howto.html and http://www.tldp.org/HOWTO/SSL-RedHat-HOWTO-3.html#ss3.1 - this second one is old, but should still be valid.
|
|
|
02-02-2006, 05:42 PM
|
#7
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
ok.. cert is all setup... im still not able to view my website via SSL... when i try:
apachectl startssl
it tells me it cannot start, but it will start without ssl
|
|
|
02-02-2006, 06:14 PM
|
#8
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
I can't get to a box with Apache installed on it at the moment to check, but I think apachectl -t will check the syntax of your config file. Can you post any errors you get from that please?
|
|
|
02-02-2006, 10:01 PM
|
#9
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
i ran:
apachectl configtest
and i get back
syntax OK
as i stated... apache runs fine... lemme get a snippet of the mod_ssl_engine log and post its latest stuff
|
|
|
02-02-2006, 10:12 PM
|
#10
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
Code:
[02/Feb/2006 23:20:18 04091] [info] Init: 1st restart round (already detached)
[02/Feb/2006 23:20:18 04091] [info] Init: Reinitializing OpenSSL library
[02/Feb/2006 23:20:18 04091] [info] Init: Seeding PRNG with 1160 bytes of entropy
[02/Feb/2006 23:20:18 04091] [info] Init: Configuring temporary RSA private keys (512/1024 bits)
[02/Feb/2006 23:20:18 04091] [info] Init: Configuring temporary DH parameters (512/1024 bits)
[02/Feb/2006 23:20:18 04091] [info] Init: Initializing (virtual) servers for SSL
[02/Feb/2006 23:22:36 04091] [info] Init: 2nd restart round (already detached)
[02/Feb/2006 23:22:36 04091] [info] Init: Reinitializing OpenSSL library
[02/Feb/2006 23:22:36 04091] [info] Init: Seeding PRNG with 1160 bytes of entropy
[02/Feb/2006 23:22:36 04091] [info] Init: Configuring temporary RSA private keys (512/1024 bits)
[02/Feb/2006 23:22:36 04091] [info] Init: Configuring temporary DH parameters (512/1024 bits)
[02/Feb/2006 23:22:36 04091] [info] Init: Initializing (virtual) servers for SSL
[02/Feb/2006 23:25:15 04383] [info] Server: Apache/1.3.33, Interface: mod_ssl/2.8.24, Library: OpenSSL/0.9.7g
[02/Feb/2006 23:25:15 04383] [info] Init: 1st startup round (still not detached)
[02/Feb/2006 23:25:15 04383] [info] Init: Initializing OpenSSL library
[02/Feb/2006 23:25:15 04383] [info] Init: Loading certificate & private key of SSL-aware server www.ironchefbadass.com:443
[02/Feb/2006 23:25:15 04383] [error] Init: Unable to read server certificate from file /etc/apache/ssl.crt/server.crt (OpenSSL library error follows)
[02/Feb/2006 23:25:15 04383] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data
[02/Feb/2006 23:39:42 04396] [info] Server: Apache/1.3.33, Interface: mod_ssl/2.8.24, Library: OpenSSL/0.9.7g
[02/Feb/2006 23:39:42 04396] [info] Init: 1st startup round (still not detached)
[02/Feb/2006 23:39:42 04396] [info] Init: Initializing OpenSSL library
[02/Feb/2006 23:39:42 04396] [info] Init: Seeding PRNG with 136 bytes of entropy
[02/Feb/2006 23:39:42 04396] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[02/Feb/2006 23:39:43 04396] [info] Init: Configuring temporary DH parameters (512/1024 bits)
[02/Feb/2006 23:39:44 04397] [info] Init: 2nd startup round (already detached)
[02/Feb/2006 23:39:44 04397] [info] Init: Reinitializing OpenSSL library
[02/Feb/2006 23:39:44 04397] [info] Init: Seeding PRNG with 136 bytes of entropy
[02/Feb/2006 23:39:44 04397] [info] Init: Configuring temporary RSA private keys (512/1024 bits)
[02/Feb/2006 23:39:44 04397] [info] Init: Configuring temporary DH parameters (512/1024 bits)
[02/Feb/2006 23:39:44 04397] [info] Init: Initializing (virtual) servers for SSL
is what i get after i restart apache and try to hit the site via https
how can it not read the cert???
heres the perms on server.crt:
-rw-r--r-- 1 root root 68 2001-10-16 08:05 server.crt
error log is clean of any SSL errors
ill also add that port 443 is forwarded to my webserver... i cant think of what would be preventing this from working
Last edited by scrupul0us; 02-02-2006 at 10:31 PM.
|
|
|
02-03-2006, 12:26 AM
|
#11
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
Did you get any errors creating the self signed certificate and did it ask you for a passphrase when you started Apache (it's possible to strip the passphrase out, I don't know if you did that)? The following are from the Apache docs and might help highlight what is happening with the cert. I got this from http://httpd.apache.org/docs/2.0/ssl...html#httpstest:
Try a second carriage return after the GET / HTTP/1.0 with this one
Code:
$ openssl s_client -connect localhost:443 -state -debug
GET / HTTP/1.0
Code:
curl https://localhost/
curl -k https://localhost/
Sorry it's not more informative...
|
|
|
02-03-2006, 09:33 AM
|
#12
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
when i made the cert i got no errors, it DID ask for a passphrase
as for the first code block
Code:
root@SERVER:~# openssl s_client -connect localhost:443 -state -debug
connect: Connection refused
connect:errno=29
this:
$ openssl s_client -connect localhost:443 -state -debug
GET / HTTP/1.0
wont work when the GET is on the other line
and second
Code:
root@SERVER:~# curl https://localhost/
curl: (7) couldn't connect to host
root@SERVER:~# curl -k https://localhost/
curl: (7) couldn't connect to host
Last edited by scrupul0us; 02-03-2006 at 09:35 AM.
|
|
|
02-03-2006, 02:36 PM
|
#13
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
It sounds like it's going through its startup but still not being able to use the cert. If it's actually running http & https you should get a similar output to the following:
Code:
# netstat -ape | egrep ':https .* LISTEN|:443 .* LISTEN|:http .* LISTEN|:80 .* LISTEN'
tcp 0 0 *:http *:* LISTEN root 1919713 21401/httpd
tcp 0 0 *:https *:* LISTEN root 1919718 21401/httpd
About the only things left (assuming you've left the conf file ssl settings at their defaults) is to confirm that the cert creation and copying to the /etc/apache/ssl.crt/server.crt and /etc/apache/ssl.key/server.key locations worked properly. The most useful doc I've seen for this is http://slacksite.com/apache/certificate.html
|
|
|
02-03-2006, 09:41 PM
|
#14
|
Member
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159
Original Poster
Rep:
|
i tried that site and still gettin errors:
Code:
03/Feb/2006 22:51:58 06718] [info] Server: Apache/1.3.33, Interface: mod_ssl/2.8.24, Library: OpenSSL/0.9.7g
[03/Feb/2006 22:51:58 06718] [info] Init: 1st startup round (still not detached)
[03/Feb/2006 22:51:58 06718] [info] Init: Initializing OpenSSL library
[03/Feb/2006 22:51:58 06718] [info] Init: Loading certificate & private key of SSL-aware server www.ironchefbadass.com:443
[03/Feb/2006 22:51:58 06718] [error] Init: Unable to read server certificate from file /etc/apache/ssl.crt/server.crt (OpenSSL library error follows)
[03/Feb/2006 22:51:58 06718] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data
could it be a permissions issue? group and user for the apache folder is root and root
|
|
|
02-03-2006, 09:49 PM
|
#15
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
If the directory is world readable it should be OK. I have all of my apache stuff owned by apache:apache and world (or other if you prefer) permissions are set to zero. That way only root and apache can see it (and the apache user has no shell).
I'm at a bit of a loss, those are the same docs I used to create my keys/certs. I did compile my apache (2.0.55) manually though with:
Code:
./configure --with-layout=Apache --prefix=/usr/local/apache2 --enable-rule=SHARED_CORE --enable-so --enable-ssl --enable-rewrite --with-ssl=/usr/include
|
|
|
All times are GMT -5. The time now is 09:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|