Intercept, inspect, manipulate HTTP/HTTPS traffic
npm install -g hinnpm update -g hinFirst time run:
hinwill generate private key and Root CA certificate inside ~/.hin folder.
Proxy will be listening in 8001 port by default. To specify custom port use --port option:
hin --port 4001Next time you run Http Interceptor it will check for generated certificate and use it. In addition you can specify path to custom private key and Root CA certificate:
hin --cert <path_to_root_cartificate> --key <path_to_private_key>You can re-generate private key and Root CA certificate by using --generate option:
hin --generateFor Http Interceptor to be able to intercept SSL traffic you need to add generated Root CA to Trusted Roots.
The following command will add generated certificate to your login keychain and mark as trusted:
security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain ~/.hin/_ca.crtsudo cp ~/.hin/_ca.crt /usr/local/share/ca-certificates/hin_ca.crt
sudo update-ca-certificatessudo cp ~/.hin/_ca.crt /etc/pki/ca-trust/source/anchors/hin_ca.crt
sudo update-ca-trustsudo cp ~/.hin/_ca.crt /etc/ca-certificates/trust-source/anchors/hin_ca.crt
sudo update-ca-trustsudo cp ~/.hin/_ca.crt /usr/share/ca-certificates/hin_ca.crt
sudo update-ca-certificatesThe following powershell commands will add generated certificate to current user's Trusted Root Certification Authorities list:
PS> Import-Module pki
PS> Import-Certificate -FilePath "${env:USERPROFILE}\.hin\_ca.crt" -CertStoreLocation Cert:\CurrentUser\RootFirefox manages its own certificate authorities list.
Open Preferences (about:preferences) View Certificates section and import generated Root CA certificate. You need to check 'This certificate can identify websites.' during import.
Chromium manages its own certificate authorities list.
Open Certificate Settings (chrome://settings/certificates) Authorities section and import generated Root CA certificate. You need to check 'Trust this certificate for identifying websites' during import.