Skip to content

Commit 4183512

Browse files
chore(release): 6.2.0 [skip ci]
# [6.2.0](Rapsssito/react-native-tcp-socket@v6.1.0...v6.2.0) (2024-07-08) ### Features * **Android:** Add TLS key & cert for server ([Rapsssito#192](Rapsssito#192)) ([054c789](Rapsssito@054c789))
1 parent 7d931c8 commit 4183512

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [6.2.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v6.1.0...v6.2.0) (2024-07-08)
2+
3+
4+
### Features
5+
6+
* **Android:** Add TLS key & cert for server ([#192](https://github.com/Rapsssito/react-native-tcp-socket/issues/192)) ([054c789](https://github.com/Rapsssito/react-native-tcp-socket/commit/054c7890dc0575acceb93c24794c0fade6c548a8))
7+
18
# [6.1.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v6.0.6...v6.1.0) (2024-06-20)
29

310

coverage/coverage-final.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/types/TLSSocket.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
/**
22
* @typedef {object} TLSSocketOptions
33
* @property {any} [ca]
4+
* @property {any} [key]
5+
* @property {any} [cert]
6+
* @property {string} [androidKeyStore]
7+
* @property {string} [certAlias]
8+
* @property {string} [keyAlias]
9+
* @property {string[]} [resolvedKeys]
410
*
511
* @extends {Socket}
612
*/
713
export default class TLSSocket extends Socket {
14+
/**
15+
* @private
16+
* Resolves the asset source if necessary and registers the resolved key.
17+
* @param {TLSSocketOptions} options The options object containing the source to be resolved.
18+
* @param {'ca' | 'key' | 'cert'} key The key name being resolved.
19+
*/
20+
private static resolveAssetIfNeeded;
821
/**
922
* @param {Socket} socket Any instance of `Socket`.
1023
* @param {TLSSocketOptions} [options] Options for the TLS socket.
@@ -22,8 +35,16 @@ export default class TLSSocket extends Socket {
2235
* @private
2336
*/
2437
private _startTLS;
38+
getCertificate(): any;
39+
getPeerCertificate(): any;
2540
}
2641
export type TLSSocketOptions = {
2742
ca?: any;
43+
key?: any;
44+
cert?: any;
45+
androidKeyStore?: string | undefined;
46+
certAlias?: string | undefined;
47+
keyAlias?: string | undefined;
48+
resolvedKeys?: string[] | undefined;
2849
};
2950
import Socket from "./Socket";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-tcp-socket",
33
"title": "React Native Tcp Socket",
4-
"version": "6.1.0",
4+
"version": "6.2.0",
55
"description": "React Native TCP socket API for Android & iOS with SSL/TLS support",
66
"main": "src/index.js",
77
"types": "lib/types/index.d.ts",

0 commit comments

Comments
 (0)