Skip to content

Commit

Permalink
Merge pull request eoinsha#14 from bibol/SSLFactory
Browse files Browse the repository at this point in the history
added SSLFactory setter
  • Loading branch information
eoinsha committed Feb 13, 2016
2 parents b7dd490 + 4c41c3a commit 0e49817
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/phoenixframework/channels/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.squareup.okhttp.ws.WebSocket;
import com.squareup.okhttp.ws.WebSocketCall;
import com.squareup.okhttp.ws.WebSocketListener;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSocketFactory;
import okio.Buffer;

import java.io.IOException;
Expand Down Expand Up @@ -376,6 +378,14 @@ private void triggerChannelError() {
}
}

public void setSSLSocketFactory(SSLSocketFactory sslSocketFactory) {
httpClient.setSslSocketFactory(sslSocketFactory);
}

public void setHostnameVerifier(HostnameVerifier hostnameVerifier) {
httpClient.setHostnameVerifier(hostnameVerifier);
}

private void flushSendBuffer() {
while (this.isConnected() && !this.sendBuffer.isEmpty()) {
final RequestBody body = this.sendBuffer.removeFirst();
Expand Down

0 comments on commit 0e49817

Please sign in to comment.