Skip to content

Commit fc7491e

Browse files
Update README.md
modify Self-Signed SSL Server
1 parent 4cc7be6 commit fc7491e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,30 @@ public class MainApplication extends Application implements ReactApplication {
951951
}
952952
````
953953

954+
#### Kotlin
955+
````kotlin
956+
....
957+
import com.ReactNativeBlobUtil.ReactNativeBlobUtilUtils;
958+
import javax.net.ssl.X509TrustManager
959+
...
960+
961+
public class MainApplication extends Application implements ReactApplication {
962+
...
963+
public void onCreate() {
964+
...
965+
ReactNativeBlobUtilUtils.sharedTrustManager = object : X509TrustManager {
966+
override fun checkClientTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
967+
968+
override fun checkServerTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
969+
970+
override fun getAcceptedIssuers(): Array<java.security.cert.X509Certificate> {
971+
return arrayOf()
972+
}
973+
};
974+
...
975+
}
976+
````
977+
954978
```js
955979
ReactNativeBlobUtil.config({
956980
trusty: true

0 commit comments

Comments
 (0)