![]() ![]() Go to start menu, type the following and press enter:ĭouble click “Trusted Root Certification Authorities”. Once this has completed successfully you will find all the private keys and certificates created in :Īnd C:\xampp\apache\conf\ssl.key Step 4 – Install the Certificates Open a command prompt (eg from the Windows start menu type cmd in Windows search) then enterĪssuming you have installed xampp in C:\xampp\apache If openssl is in your PATH you wont need bin\ in front of it.So if you have more than 2 you will need to repeat the set DOMAIN= and the call to bin\openssl req. You will need to change the value set for DOMAIN for each virtual host you are using.The only part of -subj value that is important is the value in /CN=.I previously put this in the V3.ext file but having combined the openssl calls into 1 call I needed to pass these values differently as the openssl req command doesn’t support extfile like x509 did, instead it passes key=value pairs via -addext V3_EXT is a list of all the virtual hosts that you are using.This script assumes that your XAMPP has been installed in C:\xampp, you may need to change this otherwise.Some notes and explanations of the above script: Set V3_EXT=subjectAltName=DNS:localhost,DNS:127.0.0.1,DNS:local.website1,DNS:local.website2īin\openssl req -subj "/C=AU/ST=NSW/L=Sydney/O=Janette Towell/OU= /CN=%DOMAIN%" -x509 -addext %V3_EXT% -nodes -days 365 -newkey rsa:2048 -keyout %HOME%\ssl.key\%DOMAIN%-selfsigned.key -out %HOME%\ssl.crt\%DOMAIN%-selfsigned.crt If not exist %HOME%\ssl.key mkdir %HOME%\ssl.key If not exist %HOME%\ssl.crt mkdir %HOME%\ssl.crt In C:\xampp\apache create a file, I decided to call it makecert_bulk.bat given that is what it is going to do. Given that I am now needing to create more than 1 self-signed certificate and that I will be repeating this process each year, I decided it was easiest to create a bat file that I can just update and run each year. LoadModule rewrite_module modules/mod_rewrite.so Make sure that the rewrite_module is uncommented (ie no semi colon at the start of the line). Ie remove the semi colon ( ) in front of the line If you have previously setup self-signed SSL certificates you will have already done this.įor the SSL we are going to use openssl, so we need to make sure that the openssl line is not commented out. The 8 Step Processįor completness I have included this step, which I mentioned in my previous post. This then meant that I needed self-signed SSL certificates for not just localhost but also for local.website1 etc.įurther to my previous post I also realised that these certificates are setup with a 365 day expiry (ie -days 365), so I need to repeat this process each year (or set a longer expiry). I now also have some sites setup using virtual hosts so I access them using eg. In my previous post I mentioned that I run a lot of WordPress instances using localhost to access them eg Setting up virtual hosts is another topic altogether that I will cover in another post. This post is an expansion of the original, covering how to setup self-signed SSL certificates for virtual hosts also. ![]() I therefore needed to tackle the issue of also setting up SSL for my virtual hosts. Well, a lot has changed in a year, and it has now become necessary for me to sometimes use virtual hosts. I also mention at the time that I wasn’t using any virtual hosts. Last year I wrote a post about Setting up a self-signed SSL certificate for localhost when using XAMPP on Windows, in it I outlined the steps I used to setup SSL for my localhost. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |