Skip to content
GoNetSim

TLS

Implementation specification & reference for TLS

GoNetSim can run HTTPS (and any TLS-wrapped custom listener) using either:

  • A user-provided certificate/key (configured in https.cert/https.key), or
  • An auto-generated certificate/key.

When https.cert/https.key are not set, GoNetSim will use a persisted, auto-generated keypair stored next to the active config.toml.

The following files are created in the same directory as config.toml if they don’t already exist:

  • gonetsim-cert.pem: server certificate PEM
  • gonetsim-key.pem: server private key PEM
  • gonetsim-ca.pem: CA certificate PEM

On subsequent starts, if gonetsim-cert.pem and gonetsim-key.pem exist, GoNetSim reuses them. This keeps the server certificate stable across restarts, and is useful for malware which pin certificates.

To avoid TLS warnings in tools/browsers, install the CA certificate (gonetsim-ca.pem) into your analysis VM.

  1. Copy gonetsim-ca.pem to your local user’s CA certificates directory

    Terminal window
    sudo cp ~/.config/gonetsim/gonetsim-ca.pem /usr/local/share/ca-certificates/gonetsim-ca.crt
  2. Update the CA certificates

    Terminal window
    sudo update-ca-certificates

Regenerating the auto-generated certificates

Section titled “Regenerating the auto-generated certificates”
  1. Run the tls --force command

    Terminal window
    gonetsim tls --force

You can verify the TLS certificates with the tls --verify-only flag

Terminal window
gonetsim tls --verify-only