Kendala Login HTTPS di Hotspot Mikrotik
Sebelumnya asumsi bahwa MikroTik + Hotspot dah keinstall dengan maknyuss ….
Kali ini hanya mengubah authentikasi Mikrotik Hotspotnya menjadi HTTPS.
Proses untuk authentikasi login HTTPS yaitu :
- Buat Certificate
Untuk membuat certificate dibutuhkan aplikasi OpenSSL atau yang lainnya. Versi windowsnya dapat didownload pada http://www.slproweb.com/products/Win32OpenSSL.html. Setelah didownload, lalu diinstall
Cara pembuatannya (versi windows, untuk linux disesuaikan ajah) :
- Buka command prompt lalu pindah ke direktori bin pada OpenSSL
- Jalankan perintah “openssl genrsa -des3 -out server.key 1024“, lalu isi data yang dibutuhkan.
Loading ‘screen’ into random state – done
Generating RSA private key, 1024 bit long modulus
……+++++++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying – Enter pass phrase for server.key: - Jalankan perintah “openssl req -new -x509 -days 365 -key server.key -out server.crt“, lalu isi data yang dibutuhkan.
Enter pass phrase for server.key:
You are about to be asked to enter information that will be incorporated into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:ID
State or Province Name (full name) [Some-State]:Tangerang
Locality Name (eg, city) []:Cipondoh
Organization Name (eg, company) [Internet Widgits Pty Ltd]:PT. Zhay Maknyuss
Organizational Unit Name (eg, section) []:ISP
Common Name (eg, YOUR name) []:Zhay
Email Address []:zhay@zhaymaknyus.com
- Import Certificate
Setelah file server.key dan server.crt terbuat, maka selanjutnya mengimport kedalam Mikrotik.
Import file ke Mikrotik :
- Pastikan bahwa port ftp terbuka, jalankan perintah “/ip service enable ftp“
- Lalu upload kedua file tersebut ke Mikrotik (pastikan bahwa command prompt berada pada direktori letak file server.key dan server.crt)
C:\OpenSSL\bin>ftp 192.168.1.1
Connected to 192.168.1.1.
220 MikroTik FTP server (MikroTik 2.9.51) ready
User (192.168.1.1:(none)): admin
331 Password required for admin
Password:
230 User admin logged in
ftp> put server.key
200 PORT command successful
150 Opening ASCII mode data connection for ‘/server.key’
226 ASCII transfer complete
ftp> put server.crt
200 PORT command successful
150 Opening ASCII mode data connection for ‘/server.crt’
226 ASCII transfer complete
ftp> ls
200 PORT command successful
150 Opening data connection
.
..
hotspot server.crt server.key
226 Transfer complete
ftp: 74 bytes received in 0.11Seconds 0.67Kbytes/sec.
ftp> quit
221 Closing
C:\OpenSSL\bin> - Import kedua file tersebut ke Mikrotik
[admin@MikroTik] > certificate
[admin@MikroTik] certificate> import
passphrase: ****************
certificates-imported: 1
private-keys-imported: 0
files-imported: 1
decryption-failures: 0
keys-with-no-certificate: 1
[admin@MikroTik] certificate> import
passphrase: ****************
certificates-imported: 0
private-keys-imported: 1
files-imported: 1
decryption-failures: 0
decryption-failures: 0
keys-with-no-certificate: 0
[admin@MikroTik] certificate> print
Flags: K – decrypted-private-key, Q – private-key, R – rsa, D – dsa
0 KR name=”cert1″ subject=C=IT,ST=xxxx,L=xxxx,O=xxxx,OU=xxxx,CN=xxxx,emailAddress=xxxx issuer=C=IT,ST=xxxx,L=xxxx,O=xxxx,OU=xxxx,CN=xxxx,
emailAddress=xxxx
serial-number=”xxxx” email=xxxx
invalid-before=xxxx invalid-after=xxxx
ca=yes
- Konfigurasi Hotspot Login menjadi HTTPS
Setelah diimport, maka selanjutnya adalah :
- Ubah profile Hotspot Login menjadi HTTPS, jalankan perintah “/ip hotspot profile set hsprof1 login-by=https“
- Ubah SSL certificate nya menjadi SSL certificate yang telah diimport sebelumnya, jalankan perintah “/ip hotspot profile set hsprofHTTPS ssl-certificate=cert1“
Tapi yang perlu di ingat yaitu pastikan bahwa browser client mendukung proses HTTPS.
Met mengubah 😀
Ref : http://forum.mikrotik.com/viewtopic.php?f=2&t=12063&start=0&st=0&sk=t&sd=a
Labels: certificate mikrotik, eror login https mikrotik, login https mikrotik, login mikrotik, sertifikat mikrotik