1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00
denoland-deno/ext
MAKS11060 e3833b5a52
fix(ext/tls): add support EC private key (#23261)
Deno works with the `EC` key, but cannot recognize it.
This code works correctly if the prefix 'EC' is removed.

```typescript
const cert = `-----BEGIN CERTIFICATE-----
MIICqjCCAZKgAwIBAgIULvZQk8us6eYdpKZraHVkW8YKL/IwDQYJKoZIhvcNAQEL
BQAwJzELMAkGA1UEBhMCVVMxGDAWBgNVBAMMD0V4YW1wbGUtUm9vdC1DQTAgFw0y
NDA0MDYwNzM4MDlaGA8yMTIzMDMxNDA3MzgwOVowbTELMAkGA1UEBhMCVVMxEjAQ
BgNVBAgMCVlvdXJTdGF0ZTERMA8GA1UEBwwIWW91ckNpdHkxHTAbBgNVBAoMFEV4
YW1wbGUtQ2VydGlmaWNhdGVzMRgwFgYDVQQDDA9sb2NhbGhvc3QubG9jYWwwWTAT
BgcqhkjOPQIBBggqhkjOPQMBBwNCAATWOALcgzz4LbNikhjVGpkOCUmR8NahjfFw
9pNBuyZnaTcjfeGfiPaV0iQqvTuQnmL+fTBw8PKxzlKGpzsodQaWo1EwTzAfBgNV
HSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAJBgNVHRMEAjAAMAsGA1UdDwQE
AwIE8DAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZIhvcNAQELBQADggEBABWp
5LsGj5mWGIy7XpksXb0k2e3fUh+CobNl4JbvE7em68nuyojm0+/vEs8Bpd9vJaUo
tU1btyTO8xUlOGeyNa9Ddd2gj3oB8IGMjxhazWTSDseZ/WqBt6OudPMmnj+jPRQL
8Hb0vyXfmabZnWO9WH9/tcCoGdUdKo2KYN/7M2ojSeRq/4BIL08lC2SVX8DlBG40
8aj3FJo9xsUG59NI31iXVN1UPEN2pakKRJdSVdpbBjxDaEoLw/TB02gqfA43T1fU
wKz+0UYxSCjeW0lOZ3wlaNN2KqiHLuQ6ePG5kqD8aRufmYWK/ImlO/ZiSX60GiPu
K1cC6aWEohOhx+k424Y=
-----END CERTIFICATE-----`
const key = `-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILL8H0x2ZP/ZZ+CwmKLS/zRleO7k7NBgWH0P767zYvlVoAoGCCqGSM49
AwEHoUQDQgAE1jgC3IM8+C2zYpIY1RqZDglJkfDWoY3xcPaTQbsmZ2k3I33hn4j2
ldIkKr07kJ5i/n0wcPDysc5Shqc7KHUGlg==
-----END EC PRIVATE KEY-----`

const config: Deno.ServeTlsOptions = {
  cert,
  // key, // not working // error: Uncaught (in promise) InvalidData: No keys found in key file
  key: key.replaceAll(' EC', ''), // remove ' EC'. it works
}

Deno.serve(config, (r) => Response.json('ok'))
```
2024-04-08 11:36:34 -06:00
..
broadcast_channel chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
cache chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
canvas chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
console chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
cron chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
crypto chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
fetch chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
ffi chore(ext/ffi): sym is unused on aarch64 linux (#23188) 2024-04-02 20:57:31 +00:00
fs FUTURE(ext/fs): make Deno.FsFile constructor illegal (#23235) 2024-04-07 15:42:53 +10:00
http chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
io chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
kv chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
napi chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
net FUTURE(ext/net): remove Deno.(Conn|TlsConn|Listener|TlsListener|UnixConn).prototype.rid (#23219) 2024-04-08 08:59:37 +10:00
node fix(ext/node): out-of-order writes of fs.createWriteStream (#23244) 2024-04-08 12:47:34 +09:00
tls fix(ext/tls): add support EC private key (#23261) 2024-04-08 11:36:34 -06:00
url chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
web fix(ext/node): count MessagePort message listeners in hasMessageEventListener (#23209) 2024-04-04 17:08:51 +02:00
webgpu chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
webidl chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
websocket chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30
webstorage chore: forward v1.42.1 release commit to main (#23162) 2024-04-01 13:35:46 +05:30