@@ -80,181 +80,93 @@ foreign import createServer :: forall eff. (Request -> Response -> Eff (http ::
8080-- | The type of HTTPS server options
8181data SSLOptions
8282
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.
8783-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
8884handshakeTimeout :: Option SSLOptions Int
8985handshakeTimeout = opt " handshakeTimeout"
9086
91- -- | If true the server will request a certificate from clients that connect and
92- -- | attempt to verify that certificate. Defaults to false.
9387-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
9488requestCert :: Option SSLOptions Boolean
9589requestCert = opt " requestCert"
9690
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.
10091-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
10192rejectUnauthorized :: Option SSLOptions Boolean
10293rejectUnauthorized = opt " rejectUnauthorized"
10394
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.)
11095-- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
11196-- | or Uint8Array.
11297-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
11398npnProtocols :: forall t . Option SSLOptions t
11499npnProtocols = opt " NPNProtocols"
115100
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.
124101-- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
125102-- | or Uint8Array.
126103-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
127104alpnProtocols :: forall t . Option SSLOptions t
128105alpnProtocols = opt " ALPNProtocols"
129106
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.
133107-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
134108sessionTimeout :: Option SSLOptions Int
135109sessionTimeout = opt " sessionTimeout"
136110
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.
140111-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
141112ticketKeys :: Option SSLOptions Buffer
142113ticketKeys = opt " ticketKeys"
143114
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.
147115-- | The type variable t should be a string or Buffer.
148116-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
149117pfx :: forall t . Option SSLOptions t
150118pfx = opt " pfx"
151119
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.
160120-- | The type variable t should be a string, string[], Buffer, Buffer[], or
161121-- | Object[].
162122-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
163123key :: forall t . Option SSLOptions t
164124key = opt " key"
165125
166- -- | Optional shared passphrase used for a single private key and/or a PFX.
167126-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
168127passphrase :: Option SSLOptions String
169128passphrase = opt " passphrase"
170129
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.
180130-- | The type variable t should be a string, string[], Buffer, or Buffer[].
181131-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
182132cert :: forall t . Option SSLOptions t
183133cert = opt " cert"
184134
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.
198135-- | The type variable t should be a string, string[], Buffer, or Buffer[].
199136-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
200137ca :: forall t . Option SSLOptions t
201138ca = opt " ca"
202139
203- -- | Optional PEM formatted CRLs (Certificate Revocation Lists).
204140-- | The type variable t should be a string, string[], Buffer, or Buffer[].
205141-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
206142crl :: forall t . Option SSLOptions t
207143crl = opt " crl"
208144
209- -- | Optional cipher suite specification, replacing the default. For more
210- -- | information, see modifying the default cipher suite.
211145-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
212146ciphers :: Option SSLOptions String
213147ciphers = opt " ciphers"
214148
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.
218149-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
219150honorCipherOrder :: Option SSLOptions Boolean
220151honorCipherOrder = opt " honorCipherOrder"
221152
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.
227153-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
228154ecdhCurve :: Option SSLOptions String
229155ecdhCurve = opt " ecdhCurve"
230156
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.
237157-- | The type variable t should be a string or Buffer.
238158-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
239159dhparam :: forall t . Option SSLOptions t
240160dhparam = opt " dhparam"
241161
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.
245162-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
246163secureProtocol :: Option SSLOptions String
247164secureProtocol = opt " secureProtocol"
248165
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.
252166-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
253167secureOptions :: Option SSLOptions Int
254168secureOptions = opt " secureOptions"
255169
256- -- | Optional opaque identifier used by servers to ensure session state is not
257- -- | shared between applications. Unused by clients.
258170-- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
259171sessionIdContext :: Option SSLOptions String
260172sessionIdContext = opt " sessionIdContext"
0 commit comments