Dukascopy
 
 
Wiki JStore Search Login

PIN code suppress (IP registration) feature not working
 Post subject: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Sun 21 Apr, 2013, 14:19 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
Greetings,

I have a trading server which connects to the JForex platform using standalone jforex API.
After updating to JForex-API 2.7.9 I found that I cannot connect to the platform any more.

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1206)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at com.dukascopy.api.impl.connect.DCClientImpl.k(Unknown Source)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(Unknown Source)

After some searching I found that this problem can be worked around by implementing a custom X509TrustManager which accepts all certificates, thus alleviating the problem.

Now, the problem is that PIN-less login does not work.

Exception in thread "main" com.dukascopy.api.system.JFAuthenticationException: Incorrect username or password
at com.dukascopy.api.impl.connect.DCClientImpl.a(Unknown Source)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(Unknown Source)

I noticed that connecting with PIN code, using the API call
client.connect(jnlpUrl, userName, password, pin)
works, however I need to be able to use
client.connect(jnlpUrl, userName, password)
to facilitate automatic reconnects.

The server has fix IP and it is registered to my account on the PIN suppression IP whitelist. I verified this in my account details and also removed the entry from the whitelist and re-added it, which has not solved the problem.

I downgraded back to JForex API 2.7.5 which I was using up till now, but all described problems remain the same.

$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

running on 64-bit Linux 2.6.32.

Please advise.


 
 Post subject: Re: PIN suppress feature not working with Standalone API Post rating: 0   New post Posted: Sun 21 Apr, 2013, 16:14 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
Quote:
Now I found logging in impossible even with the PIN-authentication method.
There is an exception when my client tries to obtain the captcha image:

Exception in thread "main" java.lang.AbstractMethodError: com.dukascopy.api.impl.connect.DCClientImpl.getCaptchaImage(Ljava/lang/String;)Ljava/awt/image/BufferedImage;


EDIT: this was caused by the hand-picked jars being messed up (since I couldn't use JForex-SDK.zip, I tried to hunt down all jars by hand). Now I ensured to use the very same jars that the JNLP-launched platform uses (in fact, I grabbed them from the javaws cache).

So the above quoted text is not relevant anymore (apart from JForex-SDK.zip not being usable), however:
- PIN code suppression still does not work (not even with the same 2.7.9 jars the JNLP client uses);
- it also does not work using the JNLP-loaded platform, not just the standalone API.


 
 Post subject: Re: PIN suppress feature not working with Standalone API Post rating: 0   New post Posted: Sun 21 Apr, 2013, 16:21 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
In case someone is interested here's how I disabled the SSL certification check in the main class of my standalone API client:

add these imports at the top of the source file:
Quote:
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;


In the main method, before calling client.connect():

Quote:
disableCertificateValidation();


and somewhere inside the main class:

Quote:
public static void disableCertificateValidation() {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
}};

// Ignore differences between given hostname and certificate hostname
HostnameVerifier hv = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) { return true; }
};

// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(hv);
} catch (Exception e) {}
}


This is based on what I found in an answer to the question at:
https://stackoverflow.com/questions/6047 ... sey-client


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Mon 22 Apr, 2013, 08:11 
User avatar

User rating: 0
Joined: Fri 05 Aug, 2011, 15:34
Posts: 14
Location: SwitzerlandSwitzerland
Hi catch22,
Thanks for that useful info.
I noticed also last night that the PIN code suppress (IP registration) feature was not working after I re-booted by PC.
It seems to be now working this morning.
FYI, mark


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Mon 22 Apr, 2013, 14:55 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
Yes, it is indeed working now.


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Sat 08 Jun, 2013, 18:48 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
Update: it seems the PIN suppression from registered IP is again not working now (yes, it's weekend again, but nevertheless quite frustrating).


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Sat 08 Jun, 2013, 22:29 

User rating: 0
Joined: Sun 21 Apr, 2013, 14:09
Posts: 7
Update: working again, seems like it's an intermittent issue.


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Sun 09 Jun, 2013, 04:09 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Can API Support make some definitive statement about all of this, please?
To me, it's confusing.
HyperScalper


 
 Post subject: Re: PIN code suppress (IP registration) feature not working Post rating: 0   New post Posted: Tue 24 Sep, 2013, 21:36 
User avatar

User rating: 0
Joined: Fri 05 Aug, 2011, 15:34
Posts: 14
Location: SwitzerlandSwitzerland
I noticed that the PIN code suppress (IP registration) feature is not working again.

Hope Dukascopy can resolve this ongoing problem as it's quite frustrating.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com