re-use cert creation from netlib in handle_sni