You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Public key pinning is important for IOT access and security in general. Having just got public key pinning working for accessing the Philips Hue API, here's a list of features that are missing from Deno's fetch/HttpClient API:
Being able to fetch an IP address (there's another bug on this already)
Being able to skip verifying the SSL certificate chain (vendors don't always provide all necessary certs and public key pinning and custom certificate verification is a suitable and safe replacement). This is equivalent to curl's --insecure command line argument.
Being able to supply a name-to-IP-address resolver: the certificate may not contain any host name or IP address that is directly addressable, so if there's any validation that compares the CN in the cert with the hostname of the URL, there has to be a way of overriding this. curl uses --resolve arguments to handle this: you supply a URL where the hostname matches the subject name in the cert then use --resolve to map that name to the IP address of the server. (Also curl's --connect-to)
Being able to provide a hash of the public key to fetch so that it can fail if the key hash doesn't match. This is public key pinning. curl uses --pinnedpubkey.
Being able to retrieve certificates and extract a hash of the public key that can be stored and passed to fetch later.
In my implementation I ended up with an HttpClient that looked like this:
I also validate when skipVerifyingCertificateChain is true that a publicKeyHashProvider is provided and that it returns a hash for the specific URL being fetched (as a runtime check even though the types already require the hash to be provided).
The text was updated successfully, but these errors were encountered:
Public key pinning is important for IOT access and security in general. Having just got public key pinning working for accessing the Philips Hue API, here's a list of features that are missing from Deno's
fetch
/HttpClient
API:--insecure
command line argument.--resolve
arguments to handle this: you supply a URL where the hostname matches the subject name in the cert then use --resolve to map that name to the IP address of the server. (Also curl's--connect-to
)fetch
so that it can fail if the key hash doesn't match. This is public key pinning. curl uses--pinnedpubkey
.fetch
later.In my implementation I ended up with an HttpClient that looked like this:
I also validate when
skipVerifyingCertificateChain
istrue
that apublicKeyHashProvider
is provided and that it returns a hash for the specific URL being fetched (as a runtime check even though the types already require the hash to be provided).The text was updated successfully, but these errors were encountered: