Configuring SSL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Configuring SSL

Postby J.Silver » 18. October 2011 22:38

Hello everyone,
I downloaded Xampp from AF. I have a script on my PC, and when I wanted to checkout (go to https to connect to a test account from authorize.net), an error message of “internet explorer cannot display the webpage” is given. Both SSL and TLS are enabled (in internet options, security). My cURL is enabled and appears in phpinfo(), and the script is updated with the login and transaction key provided by Authorize.Net. Most propably, therefore, SSL is not configured properly in Apache. My script is in a virtual host in my PC.
1. How can I check if SSL is configured properly; if not, how to configure it?
2. Do I need to define the https in the virtual host? How to do that?
Xampp: 1.7.4, Apache 2.2.17, PHP 5.3.5, MySQL 5.5.8, Windows Vista Pack 2.
Many thanks for the help.
J.Silver
 
Posts: 6
Joined: 18. October 2011 21:25
Operating System: Windows 7

Re: Configuring SSL

Postby J.Silver » 19. October 2011 23:01

I clicked on Xampp administration, and on its homepage is the following sentence:
For OpenSSL support please use the test certificate with https://127.0.0.1 or https://localhost

I clicked on the link and got the following error:
"SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error."

While I am still searching online for how to remedy this error, any quick guidance would be highly appreciated. In Windows my SSL 3 is selected.
J.Silver
 
Posts: 6
Joined: 18. October 2011 21:25
Operating System: Windows 7

Re: Configuring SSL

Postby Sharley » 19. October 2011 23:14

XAMPP is configured correctly for localhost at the https://localhost address by default unless you have changed any of the settings.
C:\xampp\apache\conf\extra\httpd-ssl.conf
You might like to use this as pointer example for your own particular needs.

Your error message seems to indicate that your certificates are incorrectly installed
Where did you see this error, was it from the C:\xampp\apache\logs\error.log file or an ssl log file?

Did you create the correct certificates and place them in the correct folders in the apache\conf folder?

Did you tell Apache where to look for these certs in your vhosts file?

Which browser are you using?

See if there are any clues re your vhost setup in these forum search results. or use your own key words.

I don't know if this link has a solution for you?
http://robsnotebook.com/xampp-ssl-encrypt-passwords
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Configuring SSL

Postby J.Silver » 24. October 2011 18:47

Dear Sharly,
Many thanks for your reply and help. I followed many tutorials on configuring SSL on Win32, however, none worked for me, and I therefore in much need of your assistance. To begin with, I deleted the previous Xampp, and freshly installed Xampp 1.7.7 to overcome any drawbacks from the many failed attempts. I am solely relying on the SSL certificate Xampp provides and this time I did not attempt to install any new one, hoping that in your step-by-step guidance, I could overcome this problem.

The wbsite to be tested is on: C:/xampp/htdocs/site/final/index.com.
Xampp directories are installed as per their default download. The only changes I made on the downloaded directories are:

httpd-vhosts.conf (available on: C:/xampp/apche/conf/extra
I made a virtual host as follows:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs
ServerName localhost
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/site/final
ServerName www.final.local
</VirtualHost>
NameVirtualHost *:443

<VirtualHost *:443>
DocumentRoot C:/xampp/htdocs
ServerName localhost
</VirtualHost>
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot C:/xampp/htdocs/site/final
ServerName https://final.local
</VirtualHost>

Windows hosts (available on: C:/Windows/System32/drivers/etc
127.0.0.1 localhost
::1 localhost

127.0.0.1 www.final.local
127.0.0.1 https://www.final.local

Config.inc.php (available on: C:/xampp/phpMyAdmin)
Added my root password inside the quotation marks of: $cfg['Servers'][$i]['password'] = '';
I noticed that Apache could not be stopped and restarted when I added to httpd-vhosts.conf :
NameVirtualHost *:443
-----------
-----------
</VirtualHost> as shown above, therefore, I deleted this entire block; the directory is now having the virtual host of port 80 only as shown above.
As I said, I am relying on the certificate and key downloaded with the Xampp and added not other certificate or key. No changes other than those above are made in any of the downloaded files. I enabled SSL 3, and TLS 1 in the Windows Internet Options/Security. My cURL is enabled. I set both firewalss of Windows and McAfee to off. I restart Apache and MySQL whenever I make changes. My website works fine but cannot checkout to https. I am using FF and the message I get is: Firefox can't find the server at www.final. My OS is Windows Vista Pack 2. My Xampp is 1.7.7. Pls. help.
J.Silver
 
Posts: 6
Joined: 18. October 2011 21:25
Operating System: Windows 7

Re: Configuring SSL

Postby Sharley » 25. October 2011 01:50

When Apache can't start when you have edited the httpd-vhosts.conf file then it indicates an error in the file.

Use the xampp-control-3-beta.exe file found in the xampp folder as this control panel has more features:

Click on the xampp-Shell button and type at the # prompt httpd.exe -S
This will show you what errors if any.

The httpd-vhosts.conf file has to be error free for Apache to start, however there will also be error message in the apache\logs error log files usually for you in the final_local_error.log file.


Try this as I have tested it and it works for me
Code: Select all
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
ServerName final.local
ServerAlias www.final.local
DocumentRoot "C:/xampp/htdocs/site/final"
<Directory "C:/xampp/htdocs/site/final" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin admins@final.local
CustomLog final_local_access.log combined
ErrorLog final_local_error.log
LogLevel debug
</VirtualHost>

<VirtualHost *:443>
ServerName final.local
ServerAlias www.final.local
DocumentRoot C:/xampp/htdocs/site/final
<Directory "C:/xampp/htdocs/site/final" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
SSLEngine on
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
ServerAdmin admins@final.local
CustomLog final_local_access_ssl.log combined
ErrorLog final_local_error_ssl.log
LogLevel debug
</VirtualHost>
You may or may not receive a warning ( I did not get a warning) as the default cert is for localhost not your final.local name but depending on your browser you can accept the certificate permanently.


Windows hosts
Code: Select all
127.0.0.1 localhost
#::1 localhost
127.0.0.1 final.local
127.0.0.1 www.final.local

You can now access using the following addresses:
http://localhost
https://localhost
http://final.local
http://www.final.local
https://final.local
https://www.final.local

Please let me know if that is what you wanted and if it works.
Thanks.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Configuring SSL

Postby JonB » 25. October 2011 02:22

I'm only suggesting this as reading matter, as I recalled 'things' from non-XAMPP VPS's I have run, after reading this interesting topic, and since we are on the subject of SSL certificates and virtualhosts.

http://wiki.apache.org/httpd/NameBasedSSLVHosts

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Configuring SSL

Postby Sharley » 25. October 2011 02:33

@ JonB
Always good to read up on this often complex issue but...

...in this case all the vhost domains are in localhost (see host file) and are covered by the default certificate but if there is a need for a separate domain certificate then there would also be a need to create a specific cert/key etc. for each domain, normally this would apply if hosting fully registered domains like in a VPS situation or creating IP based LAN domain addresses not simply for localhost development domains.

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Configuring SSL

Postby J.Silver » 25. October 2011 06:06

Dear Sharley,
Many thanks for your effort and help. I copied what you provided exactly but unfortunately the problem is not resolved yet. The following results obtained from the browsers:
IE: Internet explorer cannot display the page.
FF: Firefox cannot find the server at www.final
Chrome: gave the following message:

• Reload this webpage later.
• Check your Internet connection. Restart any router, modem, or other network devices you may be using.
• Check your DNS settings. Contact your network administrator if you're not sure what this means.
• Try disabling network prediction by following these steps: Go to the wrench menu > Options > Under the Hood and deselect "Predict network actions to improve page load performance." If this does not resolve the issue, we recommend selecting this option again for improved performance.
• Add Google Chrome as a permitted program in your firewall's or antivirus software's settings. If it is already a permitted program, try deleting it from the list of permitted programs and adding it again.
• If you use a proxy server, check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server, adjust your proxy settings: Go to the wrench menu >Options > Under the Hood > Change proxy settings... > LAN Settings and deselect the "Use a proxy server for your LAN" checkbox.
Error 105 (net::ERR_NAME_NOT_RESOLVED): Unable to resolve the server's DNS address.

Pls. note that the Chrome error this time is 105, while previousely it was 107.
I tried all Chrome suggestions above, save for checking the DNS settings, which I do not know how to do.

I clicked on the Xampp Shell Button and typed what you wrote. It only gave httpd.exe-S and the same is repeated every time I enter.

Error message in the apache\logs error log files looks like (excluding repeated errors):
[Mon Oct 24 20:37:04 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Oct 24 20:37:04 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 24 20:37:07 2011] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Oct 24 20:37:07 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Oct 24 20:37:07 2011] [notice] Parent: Created child process 3412
[Mon Oct 24 20:37:09 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 24 20:37:10 2011] [notice] Child 3412: Child process is running
[Mon Oct 24 20:37:10 2011] [notice] Child 3412: Acquired the start mutex.
[Mon Oct 24 20:37:10 2011] [notice] Child 3412: Starting 150 worker threads.
[Mon Oct 24 20:37:10 2011] [notice] Child 3412: Starting thread to listen on port 80.
[Mon Oct 24 20:37:10 2011] [notice] Child 3412: Starting thread to listen on port 443.
[Mon Oct 24 20:41:14 2011] [notice] Parent: child process exited with status 1073807364 -- Restarting.
[Mon Oct 24 20:47:58 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Oct 24 20:47:58 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 24 20:47:58 2011] [notice] Digest: done
mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Mon Oct 24 20:48:00 2011] [notice] Server built: Sep 10 2011 11:34:11
[Mon Oct 24 20:48:00 2011] [notice] Parent: Created child process 2404
[Mon Oct 24 20:48:02 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 24 20:48:04 2011] [notice] Child 2404: Child process is running
[Mon Oct 24 20:48:04 2011] [notice] Child 2404: Acquired the start mutex.
[Mon Oct 24 20:48:04 2011] [notice] Child 2404: Starting 150 worker threads.
[Mon Oct 24 20:48:04 2011] [notice] Child 2404: Starting thread to listen on port 443.
[Mon Oct 24 20:48:04 2011] [notice] Child 2404: Starting thread to listen on port 80.

Errors in final_local_error_log looks like (excluding repeated errors):
[Mon Oct 24 20:37:10 2011] [debug] proxy_util.c(1803): proxy: worker ajp://127.0.0.1:8009/examples already initialized
[Mon Oct 24 22:02:20 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/site/final/favicon.ico

My thanks to JohnB for the additional link he provided and for Sharley’s comments on it as well. Your continued support to resolve this issue is highly appreciated.
J.Silver
 
Posts: 6
Joined: 18. October 2011 21:25
Operating System: Windows 7

Re: Configuring SSL

Postby Sharley » 25. October 2011 06:20

httpd.exe-S is incorrect
I wrote:
httpd.exe -S note the space.
Paste the returned message in between forum code tags - the edit functions are in the little icon top left of the console window.

Clear all your browser's caches (temporary Internet file).

Are you using Tomcat?

The main error.log file is normal and ignore the favicon.ico error in final-local-error.log file. I am concerned about the ajp://127.0.0.1:8009 as that is related to Tomcat.

Stop Tomcat in the CP3 and try again those addresses I posted above.

BTW which of the addresses work?

The above post with all the settings as posted all work on my PC without issues.

In Vista make sure you are logged in as Admin and disable UAC temporarily if you still need to use it.

Try a reboot and see if there is any change.

Make sure if using a proxy that you allow 127.0.0.1 localhost to bye pass the proxy.

Check your host file is correct - no typos. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 61 guests