needle icon indicating copy to clipboard operation
needle copied to clipboard

Add support for custom lookup function

Open shmida1991 opened this issue 6 years ago • 0 comments

Hi,

Is there a possibility to add an option for passing a custom lookup function for https? As stated in NodeJS documentation it is possible to use custom lookup function: https://nodejs.org/api/tls.html#tls_tls_connect_options_callback

The documentation states that there are some options that can be configured and are passed directly to the https.request (and as a result to tls.connect as well)

Node.js TLS Options These options are passed directly to https.request if present. Taken from the original documentation:

pfx : Certificate, Private key and CA certificates to use for SSL. key : Private key to use for SSL. passphrase : A string of passphrase for the private key or pfx. cert : Public x509 certificate to use. ca : An authority certificate or array of authority certificates to check the remote host against. ciphers : A string describing the ciphers to use or exclude. rejectUnauthorized : If true, the server certificate is verified against the list of supplied CAs. An 'error' >event is emitted if verification fails. Verification happens at the connection level, before the HTTP >request is sent. secureProtocol : The SSL method to use, e.g. SSLv3_method to force SSL version 3.

From looking into the source code it seems like 'tls_options' string need to be updated (adding lookup as a supported tls option) I tested https.request function with options that includes a 'lookup' function, and it seems like it is actually passes the lookup to the tls.connect as well as other options. Am I right? If so I'll make a pull request with the change

shmida1991 avatar Feb 25 '19 14:02 shmida1991