Skip to content

Commit 268b0f5

Browse files
author
Joonas Kannisto
committed
Reset client before setting allowSslErrors value
1 parent 05191a8 commit 268b0f5

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,20 @@ certificatePinningAdd("mydomain.com", ["DCU5TkA8n3L8+QM7dyTjfRlxWibigF+1cxMzRhlJ
483483
certificatePinningClear();
484484
```
485485

486+
### Allow SSL errors and self-signed certificates
487+
488+
You can allow SSL errors and self-signed certificates if you want. This only works on android devices.
489+
490+
```typescript
491+
import { allowSslErrors } from "@klippa/nativescript-http";
492+
493+
/**
494+
* Allow SSL errors and self-signed certificates
495+
* @param allow true/false
496+
*/
497+
allowSslErrors(true);
498+
```
499+
486500
## Roadmap
487501
* Cache control
488502
* Allowing self signed certificates (WIP in feature/self-signed)

src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export declare function clearCookies(): void;
114114

115115
/**
116116
* Allow SSL errors and self-signed certificates
117+
* ** Only Android **
117118
* @param allow true/false
118119
*/
119120
export declare function allowSslErrors(allow: boolean): void;

src/platforms/android/java/com/klippa/NativeScriptHTTP/Async.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ public static void ClearCookies() {
231231
}
232232

233233
public static void AllowSslErrors(boolean allow) {
234+
client = null;
234235
allowSslErrors = allow;
235236
InitClient();
236237
}

0 commit comments

Comments
 (0)