Mikrotik Hotspot – Login with HTTPS

Sebelumnya asumsi bahwa MikroTik + Hotspot dah keinstall dengan maknyuss ….
Kali ini hanya mengubah authentikasi Mikrotik Hotspotnya menjadi HTTPS.

Proses untuk authentikasi login HTTPS yaitu :

  1. 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

    Setelah itu akan terdapat file server.key (private key) dan server.crt (public.key). Untuk semua data harap disesuaikan.

  2. 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

  3. 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

Wokeh .. prosesnya dah kelar deh. Tinggal di coba di client ajah ..
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

Ditulis dalam Tutorial. 16 Comments »

16 Tanggapan to “Mikrotik Hotspot – Login with HTTPS”

  1. imam Says:

    Ok bos berhasill….
    Tengyu berat

  2. husnul Says:

    Ok mas mantap, lanjut terus tutorialnya

  3. rafli Says:

    mas, please help…, gini ceritanya. semua client hotspot yang menggunakan OS Windows tidak bisa muncul jendela login dengan lancar walaupun sudah konek ke sinyal dengan baik dan mikrotik pun sudah mendeteksi keberadaan laptop tersebut, kadang2 bisa login tetapi situs fesbuk, google, dan lain-lain tidak bisa terbuka, semuanya bisa kembali lancar kalau di BYPASS alias tanpa login voucher, tetapi kalau menggunakan laptop OS Ubuntu semua lancar saja tidak ada masalah. Kejadiannya baru-baru ini saja padahal sebelumnya kurang lebih 6 bulan berjalan, semua normal. Kira-kira apa penyebabnya, saya sudah reset Mikrotik saya dan mengkonfigurasi ulang tetapi belom baik seperti semula. ada yang bilang mungkin nyangkut di ssl, tapi saya juga kurang mengerti gimana maksudnya. bisakah mas jelaskan masalah saya ini??? thanks before

    • hanadi Says:

      kemungkinan karena dns .. coba cek di dns client .. udah bener ato blom .. cek juga dns server .. up ato tidak .. trus juga .. untuk tester login pada windows .. bisa coba langsung akses ke mikrotiknya dengan http://ip_hotspotnya gituh .. jadi bisa tau apakah hotspot berjalan ato nda ..

      • rafli Says:

        Kalau di bypass tidak ada masalah, berarti menurut saya dns pada mikrotik ato client ok dan login ke ip mikrotik juga bisa. Tapi kalo di reguler (pakai login user) sepertinya tersendat atao ada yg menghalang-halangi karena kadang muncul kadang hilang, kalaupun muncul tampilan situsnya amburadul dan lambat.

  4. pbh09net Says:

    Masih mempelajari mas,… masih belum paham kegunaanya apa yaa. Dibanding dengan tanpa certificate itu gimana yach? maklum newbie, baru belajar mikriting nich.

  5. Herdin S Says:

    saya sudah berhasil mas mengikuti tutorial diatas tapai masalahnya semua tiap klien mau login pertama kali harus get certificate, jadi ribet juga untuk klien baru pada bingung… ada solusi mas?

  6. Akhmad Bayquni Says:

    Mas.. saya gagal terus nih..
    C:\d\OpenSSL-Win32\bin>openssl genrsa -des3 -out server.key 1024
    WARNING: can’t open config file: /usr/local/ssl/openssl.cnf
    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:

    C:\d\OpenSSL-Win32\bin>openssl req -new -x509 -days 365 -key server.key -out ser
    ver.crt
    WARNING: can’t open config file: /usr/local/ssl/openssl.cnf
    Unable to load config info from /usr/local/ssl/openssl.cnf

    Itu kenapa yah?? Selalu gagal pa bikin .cert nya…

    • hanadi Says:

      klo menurut link http://jaspreetchahal.org/warning-cant-open-config-file-usrlocalsslopenssl-cnf/
      caranya adalah .. pada saat command prompt jalankan

      set OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg
      atau klo diliat dari errornya maka

      set OPENSSL_CONF=C:\d\OpenSSL-Win32\bin\openssl.cfg

      baru setelah itu jalankan perintah selanjutnya …

      • rachmat saputra Says:

        mas….numpang tanya nih
        req -new -x509 -days 365 -key server.key -out server.crt
        muncul
        unable to load config info from /usr/local/ssl/openssl.cnf
        sy sudah set di c:\ command prompt
        set OPENSSL_CONF=C:\d\OpenSSL-Win32\bin\openssl.cfg
        dan set OPENSSL_CONF=C:\d\OpenSSL-Win32\bin\openssl.cnf
        tetap muncul
        unable to load config info from /usr/local/ssl/openssl.cnf

        mohon infonya ya mas

      • hanadi Says:

        Windows ya .. Hmm.. Itu alamat nya salah .. seharusnya cara baca konfignya pakai model direktori windows .. karena pesan errornya adalah pola direktori linux

  7. uchuts Says:

    untuk saat ini aman, meskipun harus get sertificate, saya sadar hotspot bukan apa” dibanding Facebook Inc. yahoo dll, hehehe,, thansk for share..

  8. Fajar Says:

    Saya sudah membuat certificate, dan sudah saya install di winbox. cuman saat client browsing https, tetap tidak bisa menampilkan halaman login. Mohon pencerahannya


Tinggalkan Balasan ke rafli Batalkan balasan