Last active
July 6, 2021 20:15
-
-
Save hijoem/4029e291c1b250902ef62094eb8fc86e to your computer and use it in GitHub Desktop.
Cara akses https melalui XAMPP di Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ req ] | |
default_bits = 2048 | |
default_keyfile = server-key.pem | |
distinguished_name = subject | |
req_extensions = req_ext | |
x509_extensions = x509_ext | |
string_mask = utf8only | |
[ subject ] | |
countryName = Country Name (2 letter code) | |
countryName_default = US | |
stateOrProvinceName = State or Province Name (full name) | |
stateOrProvinceName_default = NY | |
localityName = Locality Name (eg, city) | |
localityName_default = New York | |
organizationName = Organization Name (eg, company) | |
organizationName_default = Example, LLC | |
commonName = Common Name (e.g. server FQDN or YOUR name) | |
commonName_default = local.test | |
emailAddress = Email Address | |
emailAddress_default = [email protected] | |
[ x509_ext ] | |
subjectKeyIdentifier = hash | |
authorityKeyIdentifier = keyid,issuer | |
basicConstraints = CA:FALSE | |
keyUsage = digitalSignature, keyEncipherment | |
subjectAltName = @alternate_names | |
nsComment = "OpenSSL Generated Certificate" | |
[ req_ext ] | |
subjectKeyIdentifier = hash | |
basicConstraints = CA:FALSE | |
keyUsage = digitalSignature, keyEncipherment | |
subjectAltName = @alternate_names | |
nsComment = "OpenSSL Generated Certificate" | |
[ alternate_names ] | |
DNS.1 = local.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Buka file C:\Windows\System32\drivers\etc\host | |
# Tambahkan kode berikut di baris paling bawah | |
127.0.0.1 local.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Buka file C:\xampp\apache\conf\extra\httpd-xampp.conf | |
# Tambahkan kode berikut di baris paling bawah | |
## local.test | |
<VirtualHost *:80> | |
DocumentRoot "C:/xampp/htdocs" | |
ServerName local.test | |
ServerAlias *.local.test | |
</VirtualHost> | |
<VirtualHost *:443> | |
DocumentRoot "C:/xampp/htdocs" | |
ServerName local.test | |
ServerAlias *.local.test | |
SSLEngine on | |
SSLCertificateFile "crt/local.test/server.crt" | |
SSLCertificateKeyFile "crt/local.test/server.key" | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Buka C:\xampp\apache\ lalu buat folder crt dan masukkan cert.conf dan make-cert.bat kedalamnya | |
REM sehingga susunannya seperti berikut. | |
REM | |
REM C:\xampp\apache\crt\cert.conf | |
REM C:\xampp\apache\crt\make-cert.bat | |
REM | |
REM Klik 2x make-cert.bat tekan Enter hingga selesai | |
REM Akan ada folder baru C:\xampp\apache\cert\local.test yang berisi server.crt dan server.key | |
REM Klik 2x server.crt lalu Install Certificate ... | |
REM Pilih Local Machine > Next | |
REM Pilih Place all certificates in the following store > Browse... | |
REM Pilih Trusted Root Certidication Authorities > Ok > Next > Finish | |
REM Edit file C:\Windows\System32\drivers\etc\host sesuai contoh | |
REM Edit file C:\xampp\apache\conf\extra\httpd-xampp.conf sesuai contoh | |
REM Restart Apache di XAMPP dan juga browser | |
REM Silahkan akses https://local.test di browser | |
REM | |
REM | |
REM --------------------------------------------------------------------------- | |
REM - This tutorial is modified from: | |
REM - https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/ | |
REM - Tested on XAMPP Control Panel V3.3.0 at 17 July 2021 on Windows 10 x64 | |
REM | |
REM - Kindly visit https://www.hijoem.my.id/ and https://hijoem.com | |
REM --------------------------------------------------------------------------- | |
REM | |
set domain="local.test" | |
set OPENSSL_CONF=../conf/openssl.cnf | |
if not exist .\%domain% mkdir .\%domain% | |
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 365 -out %domain%\server.crt | |
echo. | |
echo ----- | |
echo The certificate was provided. You can close this window and install the new certificate. | |
echo. | |
pause | |
.\%domain%\server.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kindly visit https://www.hijoem.my.id/ and https://hijoem.com
C:\xampp\apache\
lalu buat foldercrt
dan masukkancert.conf
danmake-cert.bat
kedalamnya sehingga susunannya seperti berikut:C:\xampp\apache\crt\cert.conf
C:\xampp\apache\crt\make-cert.bat
make-cert.bat
tekan Enter hingga selesaiC:\xampp\apache\cert\local.test
yang berisiserver.crt
danserver.key
server.crt
lalu Install Certificate ...Local Machine
>Next
Place all certificates in the following store
>Browse...
Trusted Root Certification Authorities
>Ok
>Next
>Finish
C:\Windows\System32\drivers\etc\host
sesuai contohC:\xampp\apache\conf\extra\httpd-xampp.conf
sesuai contohRestart
Apache di XAMPP dan juga browserhttps://local.test
di browserSemoga berhasil.