Skip to content

Commit 7d931c8

Browse files
committed
docs: Add new TLSSocket options & methods
1 parent 054c789 commit 7d931c8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ React Native TCP socket API for Android, iOS & macOS with **SSL/TLS support**. I
1212
- [Getting started](#getting-started)
1313
- [Overriding `net`](#overriding-net)
1414
- [Overriding `tls`](#overriding-tls)
15-
- [Using React Native >= 0.60](#using-react-native--060)
16-
- [Self-Signed SSL (only available for React Native > 0.60)](#self-signed-ssl-only-available-for-react-native--060)
17-
- [Using React Native < 0.60](#using-react-native--060-1)
15+
- [Using React Native \>= 0.60](#using-react-native--060)
16+
- [Self-Signed SSL (only available for React Native \> 0.60)](#self-signed-ssl-only-available-for-react-native--060)
17+
- [Using React Native \< 0.60](#using-react-native--060-1)
1818
- [React Native Compatibility](#react-native-compatibility)
1919
- [Usage](#usage)
2020
- [Client example](#client-example)
@@ -409,6 +409,8 @@ Here are listed all methods implemented in `react-native-tcp-socket` that imitat
409409
#### TLSSocket
410410
* **Methods:**
411411
* All methods from [`Socket`](#socket)
412+
* [`getCertificate()`](https://nodejs.org/api/tls.html#tlssocketgetcertificate) _Android only_
413+
* **[`getPeerCertificate()`](https://nodejs.org/api/tls.html#tlssocketgetpeercertificatedetailed)** _Android only_
412414
* **Properties:**
413415
* All properties from [`Socket`](#socket)
414416
* **Events:**
@@ -418,10 +420,15 @@ Here are listed all methods implemented in `react-native-tcp-socket` that imitat
418420
##### `tls.connectTLS()` <!-- omit in toc -->
419421
`tls.connectTLS(options[, callback])` creates a TLS socket connection using the given `options`. The `options` parameter must be an `object` with the following properties:
420422

421-
| Property | Type | iOS/macOS | Android | Description |
422-
| -------- | ---------- | :-------: | :-----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
423-
| `ca` | `<import>` ||| CA file (.pem format) to trust. If `null`, it will use the device's default SSL trusted list. Useful for self-signed certificates. _Check the [documentation](#self-signed-ssl-only-available-for-react-native--060) for generating such file_. **Default**: `null`. |
424-
| `...` | `<any>` ||| Any other [`socket.connect()`](#netcreateconnection----omit-in-toc) options not already listed. |
423+
| Property | Type | iOS/macOS | Android | Description |
424+
| ----------------- | ---------- | :-------: | :-----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
425+
| `ca` | `<import>` ||| CA file (.pem format) to trust. If `null`, it will use the device's default SSL trusted list. Useful for self-signed certificates. _Check the [documentation](#self-signed-ssl-only-available-for-react-native--060) for generating such file_. **Default**: `null`. |
426+
| `key` | `<import>` ||| Private key file (.pem format). _Check the [documentation](#self-signed-ssl-only-available-for-react-native--060) for generating such file_. |
427+
| `cert` | `<import>` ||| Public certificate file (.pem format). _Check the [documentation](#self-signed-ssl-only-available-for-react-native--060) for generating such file_. |
428+
| `androidKeyStore` | `<string>` ||| Android KeyStore alias. |
429+
| `certAlias` | `<string>` ||| Android KeyStore certificate alias. |
430+
| `keyAlias` | `<string>` ||| Android KeyStore private key alias. |
431+
| `...` | `<any>` ||| Any other [`socket.connect()`](#netcreateconnection----omit-in-toc) options not already listed. |
425432

426433
#### TLSServer
427434
__Note__: The TLS server is named `Server` in Node's tls, but it is named `TLSServer` in `react-native-tcp-socket` in order to avoid confusion with the [`Server`](#server) class.

0 commit comments

Comments
 (0)