crypto: allow custom generator for DiffieHellman
net: add localPort to connect options

Expose localPort for binding to a specific port for outbound
connections.

If localAddress is not specified '0.0.0.0' is used for ip4 and '::'
for ip6 connections.

Fixes #7092