Skip to content

Commit

Permalink
SSL/TLS port from URL with fallback to default protocol port
Browse files Browse the repository at this point in the history
  • Loading branch information
d053434 authored and d053434 committed May 18, 2019
1 parent d722ce7 commit 1719be8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/mps/deepviolet/api/DVFactory.java
Expand Up @@ -59,7 +59,11 @@ public static final synchronized IDVSession initializeSession(URL url) throws DV
// Creates default working dir if needed for log files.
FileUtils.createWorkingDirectory();

socket = (SSLSocket) factory.createSocket(url.getHost(), url.getDefaultPort());
int sslPort = url.getDefaultPort();
if(url.getPort() > 0) {
sslPort = url.getPort();
}
socket = (SSLSocket) factory.createSocket(url.getHost(), sslPort);

// Add interfaces
InetAddress[] addresses = InetAddress.getAllByName(url.getHost());
Expand Down

0 comments on commit 1719be8

Please sign in to comment.