Skip to content

Commit ad65b1d

Browse files
committed
[README] Update Smack example: use setCustomX509TrustManager()
1 parent 6559d9e commit ad65b1d

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,26 @@ Pin Value: PLAIN:30820222300d06092a864886f70d01010105000382020f003082020a0282020
4848

4949

5050
```java
51-
SSLContext sc = JavaPinning
52-
.forPin("SHA256:e3b1812d945da1a2a2c5fa28029d2fe34c7c4142fb098f5cfedff1ff20e98781");
51+
X509TrustManager tm = Java7Pinning
52+
.trustManagerForPin("SHA256:e3b1812d945da1a2a2c5fa28029d2fe34c7c4142fb098f5cfedff1ff20e98781");
5353
```
5454

5555
Now you can setup this context.
5656

5757
Examples
5858
--------
5959

60-
# [Smack](http://www.igniterealtime.org/projects/smack/) 4.0
61-
62-
```java
63-
ConnectionConfiguration conf =
64-
conf.setCustonSSLContext(sc);
65-
```
66-
67-
# [Smack](http://www.igniterealtime.org/projects/smack/) 4.1
60+
# [Smack](http://www.igniterealtime.org/projects/smack/)
6861

6962

7063
```java
64+
X509TrustManager tm = Java7Pinning
65+
.trustManagerForPin("SHA256:e3b1812d945da1a2a2c5fa28029d2fe34c7c4142fb098f5cfedff1ff20e98781");
7166
XMPPTCPConnectionConfiguration conf = XMPPTCPConnectionConfiguration.builder()
72-
.setUsernameAndPassword("user", "pass").setService("example.org")
73-
.setCustomSSLContext(sc).build();
67+
.setUsernameAndPassword("user", "pass")
68+
.setService("example.org")
69+
.setCustomX509TrustManager(tm)
70+
.build()
7471
```
7572

7673
How to add this as dependency
@@ -79,7 +76,7 @@ How to add this as dependency
7976
### Gradle
8077

8178
```groovy
82-
compile('eu.geekplace.javapinning:java-pinning-core:1.1.1')
79+
compile('eu.geekplace.javapinning:java-pinning-core:1.2.0')
8380
```
8481

8582
### Maven
@@ -88,7 +85,7 @@ compile('eu.geekplace.javapinning:java-pinning-core:1.1.1')
8885
<dependency>
8986
<groupId>eu.geekplace.javapinning</groupId>
9087
<artifactId>java-pinning-core</artifactId>
91-
<version>1.1.1</version>
88+
<version>1.2.0</version>
9289
</dependency>
9390
```
9491

0 commit comments

Comments
 (0)