@@ -80,181 +80,93 @@ foreign import createServer :: forall eff. (Request -> Response -> Eff (http ::
80
80
-- | The type of HTTPS server options
81
81
data SSLOptions
82
82
83
- -- | Abort the connection if the SSL/TLS handshake does not finish in the
84
- -- | specified number of milliseconds. Defaults to 120 seconds. A
85
- -- | 'tlsClientError' is emitted on the tls.Server object whenever a handshake
86
- -- | times out.
87
83
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
88
84
handshakeTimeout :: Option SSLOptions Int
89
85
handshakeTimeout = opt " handshakeTimeout"
90
86
91
- -- | If true the server will request a certificate from clients that connect and
92
- -- | attempt to verify that certificate. Defaults to false.
93
87
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
94
88
requestCert :: Option SSLOptions Boolean
95
89
requestCert = opt " requestCert"
96
90
97
- -- | If not false the server will reject any connection which is not authorized
98
- -- | with the list of supplied CAs. This option only has an effect if
99
- -- | requestCert is true. Defaults to true.
100
91
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
101
92
rejectUnauthorized :: Option SSLOptions Boolean
102
93
rejectUnauthorized = opt " rejectUnauthorized"
103
94
104
- -- | An array of strings, Buffers or Uint8Arrays, or a single Buffer or
105
- -- | Uint8Array containing supported NPN protocols. Buffers should have the
106
- -- | format [len][name][len][name]... e.g. 0x05hello0x05world, where the first
107
- -- | byte is the length of the next protocol name. Passing an array is usually
108
- -- | much simpler, e.g. ['hello', 'world']. (Protocols should be ordered by
109
- -- | their priority.)
110
95
-- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
111
96
-- | or Uint8Array.
112
97
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
113
98
npnProtocols :: forall t . Option SSLOptions t
114
99
npnProtocols = opt " NPNProtocols"
115
100
116
- -- | An array of strings, Buffers or Uint8Arrays, or a single Buffer or
117
- -- | Uint8Array containing the supported ALPN protocols. Buffers should have the
118
- -- | format [len][name][len][name]... e.g. 0x05hello0x05world, where the first
119
- -- | byte is the length of the next protocol name. Passing an array is usually
120
- -- | much simpler, e.g. ['hello', 'world']. (Protocols should be ordered by
121
- -- | their priority.) When the server receives both NPN and ALPN extensions from
122
- -- | the client, ALPN takes precedence over NPN and the server does not send an
123
- -- | NPN extension to the client.
124
101
-- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
125
102
-- | or Uint8Array.
126
103
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
127
104
alpnProtocols :: forall t . Option SSLOptions t
128
105
alpnProtocols = opt " ALPNProtocols"
129
106
130
- -- | An integer specifying the number of seconds after which the TLS session
131
- -- | identifiers and TLS session tickets created by the server will time out.
132
- -- | See SSL_CTX_set_timeout for more details.
133
107
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
134
108
sessionTimeout :: Option SSLOptions Int
135
109
sessionTimeout = opt " sessionTimeout"
136
110
137
- -- | A 48-byte Buffer instance consisting of a 16-byte prefix, a 16-byte HMAC
138
- -- | key, and a 16-byte AES key. This can be used to accept TLS session tickets
139
- -- | on multiple instances of the TLS server.
140
111
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
141
112
ticketKeys :: Option SSLOptions Buffer
142
113
ticketKeys = opt " ticketKeys"
143
114
144
- -- | Optional PFX or PKCS12 encoded private key and certificate chain. pfx is an
145
- -- | alternative to providing key and cert individually. PFX is usually
146
- -- | encrypted, if it is, passphrase will be used to decrypt it.
147
115
-- | The type variable t should be a string or Buffer.
148
116
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
149
117
pfx :: forall t . Option SSLOptions t
150
118
pfx = opt " pfx"
151
119
152
- -- | Optional private keys in PEM format. PEM allows the option of private keys
153
- -- | being encrypted. Encrypted keys will be decrypted with options.passphrase.
154
- -- | Multiple keys using different algorithms can be provided either as an array
155
- -- | of unencrypted key strings or buffers, or an array of objects in the form
156
- -- | {pem: <string|buffer>[, passphrase: <string>]}. The object form can only
157
- -- | occur in an array. object.passphrase is optional. Encrypted keys will be
158
- -- | decrypted with object.passphrase if provided, or options.passphrase if it
159
- -- | is not.
160
120
-- | The type variable t should be a string, string[], Buffer, Buffer[], or
161
121
-- | Object[].
162
122
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
163
123
key :: forall t . Option SSLOptions t
164
124
key = opt " key"
165
125
166
- -- | Optional shared passphrase used for a single private key and/or a PFX.
167
126
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
168
127
passphrase :: Option SSLOptions String
169
128
passphrase = opt " passphrase"
170
129
171
- -- | Optional cert chains in PEM format. One cert chain should be provided per
172
- -- | private key. Each cert chain should consist of the PEM formatted
173
- -- | certificate for a provided private key, followed by the PEM formatted
174
- -- | intermediate certificates (if any), in order, and not including the root CA
175
- -- | (the root CA must be pre-known to the peer, see ca). When providing
176
- -- | multiple cert chains, they do not have to be in the same order as their
177
- -- | private keys in key. If the intermediate certificates are not provided, the
178
- -- | peer will not be able to validate the certificate, and the handshake will
179
- -- | fail.
180
130
-- | The type variable t should be a string, string[], Buffer, or Buffer[].
181
131
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
182
132
cert :: forall t . Option SSLOptions t
183
133
cert = opt " cert"
184
134
185
- -- | Optionally override the trusted CA certificates. Default is to trust the
186
- -- | well-known CAs curated by Mozilla. Mozilla's CAs are completely replaced
187
- -- | when CAs are explicitly specified using this option. The value can be a
188
- -- | string or Buffer, or an Array of strings and/or Buffers. Any string or
189
- -- | Buffer can contain multiple PEM CAs concatenated together. The peer's
190
- -- | certificate must be chainable to a CA trusted by the server for the
191
- -- | connection to be authenticated. When using certificates that are not
192
- -- | chainable to a well-known CA, the certificate's CA must be explicitly
193
- -- | specified as a trusted or the connection will fail to authenticate. If the
194
- -- | peer uses a certificate that doesn't match or chain to one of the default
195
- -- | CAs, use the ca option to provide a CA certificate that the peer's
196
- -- | certificate can match or chain to. For self-signed certificates, the
197
- -- | certificate is its own CA, and must be provided.
198
135
-- | The type variable t should be a string, string[], Buffer, or Buffer[].
199
136
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
200
137
ca :: forall t . Option SSLOptions t
201
138
ca = opt " ca"
202
139
203
- -- | Optional PEM formatted CRLs (Certificate Revocation Lists).
204
140
-- | The type variable t should be a string, string[], Buffer, or Buffer[].
205
141
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
206
142
crl :: forall t . Option SSLOptions t
207
143
crl = opt " crl"
208
144
209
- -- | Optional cipher suite specification, replacing the default. For more
210
- -- | information, see modifying the default cipher suite.
211
145
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
212
146
ciphers :: Option SSLOptions String
213
147
ciphers = opt " ciphers"
214
148
215
- -- | Attempt to use the server's cipher suite preferences instead of the
216
- -- | client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be set in
217
- -- | secureOptions, see OpenSSL Options for more information.
218
149
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
219
150
honorCipherOrder :: Option SSLOptions Boolean
220
151
honorCipherOrder = opt " honorCipherOrder"
221
152
222
- -- | A string describing a named curve to use for ECDH key agreement or false to
223
- -- | disable ECDH. Defaults to tls.DEFAULT_ECDH_CURVE. Use crypto.getCurves() to
224
- -- | obtain a list of available curve names. On recent releases, openssl ecparam
225
- -- | -list_curves will also display the name and description of each available
226
- -- | elliptic curve.
227
153
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
228
154
ecdhCurve :: Option SSLOptions String
229
155
ecdhCurve = opt " ecdhCurve"
230
156
231
- -- | Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
232
- -- | openssl dhparam to create the parameters. The key length must be greater
233
- -- | than or equal to 1024 bits, otherwise an error will be thrown. It is
234
- -- | strongly recommended to use 2048 bits or larger for stronger security. If
235
- -- | omitted or invalid, the parameters are silently discarded and DHE ciphers
236
- -- | will not be available.
237
157
-- | The type variable t should be a string or Buffer.
238
158
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
239
159
dhparam :: forall t . Option SSLOptions t
240
160
dhparam = opt " dhparam"
241
161
242
- -- | Optional SSL method to use, default is "SSLv23_method". The possible values
243
- -- | are listed as SSL_METHODS, use the function names as strings. For example,
244
- -- | "SSLv3_method" to force SSL version 3.
245
162
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
246
163
secureProtocol :: Option SSLOptions String
247
164
secureProtocol = opt " secureProtocol"
248
165
249
- -- | Optionally affect the OpenSSL protocol behavior, which is not usually
250
- -- | necessary. This should be used carefully if at all! Value is a numeric
251
- -- | bitmask of the SSL_OP_* options from OpenSSL Options.
252
166
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
253
167
secureOptions :: Option SSLOptions Int
254
168
secureOptions = opt " secureOptions"
255
169
256
- -- | Optional opaque identifier used by servers to ensure session state is not
257
- -- | shared between applications. Unused by clients.
258
170
-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
259
171
sessionIdContext :: Option SSLOptions String
260
172
sessionIdContext = opt " sessionIdContext"
0 commit comments