Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Merge pull request #33 from initOS/implement_timeout_for_pintan
Browse files Browse the repository at this point in the history
Add timeout for HTTPS connect and read
  • Loading branch information
willuhn committed Dec 17, 2014
2 parents 2e85ab9 + e9b8000 commit ecddf75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/org/kapott/hbci/comm/CommPinTan.java
Expand Up @@ -54,6 +54,9 @@ public final class CommPinTan
// nicht verifiziert werden sollen
private HostnameVerifier myHostnameVerifier;

// Timeout for HTTP connect and read operations in milliseconds
private final static int HTTP_TIMEOUT = 60000;


public CommPinTan(HBCIPassportInternal parentPassport)
{
Expand Down Expand Up @@ -109,6 +112,8 @@ protected void ping(MSG msg)

HBCIUtils.log("connecting to server",HBCIUtils.LOG_DEBUG);
conn=(HttpURLConnection)url.openConnection();
conn.setConnectTimeout(HTTP_TIMEOUT);
conn.setReadTimeout(HTTP_TIMEOUT);

boolean checkCert=((AbstractPinTanPassport)getParentPassport()).getCheckCert();
boolean debugging=((PinTanSSLSocketFactory)this.mySocketFactory).debug();
Expand Down

0 comments on commit ecddf75

Please sign in to comment.