|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/12/2002 Posts: 312 Location: ,
|
I'm attempting to use a jsp page to post the information back to paypal, after receiving the IPN. I basically cut and pasted the java code example from the paypal site, and I'm getting a "java.security.cert.CertificateException: Could not find trusted certificate" error. If I use straight http, it works. But, no luck with https. I've been researching for days and cannot make any headway. Here are the steps I'm taking:
URL u;
URLConnection uc;
try
{
System.out.println("about to https:");
u = new URL("https://www.paypal.com/cgi-bin/webscr");
System.out.println("URL instantiated");
uc = u.openConnection();
System.out.println("Connection opened");
uc.setDoOutput(true);
System.out.println("setDoOutput() success");
uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
System.out.println("setRequestProperty() success");
PrintWriter pw = new PrintWriter(uc.getOutputStream());
System.out.println("Printwriter instantiated");
pw.println(str);
pw.close();
}
catch (Exception e)
{
System.out.println("Error posting to http://www.paypal.com/cgi-bin/webscr!");
System.out.println(e.getMessage());
throw e;
}
|
|
|
|
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 9/16/2002 Posts: 2,960 Location: ,
|
I believe this is an issue with your SSL installation. There's very little information available. Try: http://forum.java.sun.co...rum=2&thread=295242
Patrick Breitenbach PayPal, Inc. Dev Net: https://www.paypal.com/pdn
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/12/2002 Posts: 312 Location: ,
|
Hi, I submitted the solution to connect to the secure server to paypal developer section using java servlet ,hopefully if they approve they can put in the link for how to do.If you want a code, email me at softwareObjects@hotmail.com
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/12/2002 Posts: 312 Location: ,
|
Perhaps I need to get a certificate from PayPal, and import it into my keystore? I don't fully understand the issue here.
I'm attempting to https to paypal. What happens next? Does my SSL implementation attempt to match paypal's public key to something that I have stored on my side?
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 1/28/2003 Posts: 9 Location: ,
|
I'm surprised PayPal doesn't supply a servlet with overridden methods for each of the commands (ie. .paymentComplete()).
Also, I'm surprised how few Java posts there are in this forum (probably 'cause Java programmers are much smarter, and don't need as much help).
It would be nice to have a servlet already written though, than the JSP code.
Joel
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 9/16/2002 Posts: 2,960 Location: ,
|
We're in progress of updating our sample code to provide more guidance as well as implement new features like multi-currency. Of the 5 samples we provide, Java does seem to be the least accessed for whatever reason. Patrick Breitenbach PayPal, Inc. Dev Net: https://www.paypal.com/pdn
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 8/30/2003 Posts: 8 Location: ,
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"> Originally posted by paypal_pb[br]We're in progress of updating our sample code to provide more guidance as well as implement new features like multi-currency. Dev Net: https://www.paypal.com/pdn
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"> I think that the example Java code actually performs a GET when notified by IPN, when it should perform a POST. From the API docs of HttpURLConnection: setRequestMethod public void setRequestMethod(String method) throws ProtocolExceptionSet the method for the URL request, one of: GET POST HEAD OPTIONS PUT DELETE TRACE are legal, subject to protocol restrictions. The default method is GET In the sample code, it says: URL u = new URL("http://www.paypal.com/cgi-bin/webscr"); URLConnection uc = u.openConnection(); uc.setDoOutput(true); uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); PrintWriter pw = new PrintWriter(uc.getOutputStream()); pw.println(str); pw.close(); -- The URLConnection is actually an HttpURLConnection, and you could do the following to actually, explicitly send a POST rather than GET: URL u = new URL("http://www.paypal.com/cgi-bin/webscr"); HttpURLConnection uc=null; try{ uc = (HttpURLConnection)u.openConnection(); uc.setDoOutput(true); uc.setRequestMethod("POST"); /* AS BEFORE */ }catch(Exception e){...} Comments, suggestions? Rikard ABC, DEFG, HIJ, KL
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 9/16/2002 Posts: 2,960 Location: ,
|
We'll review this. The system does accept a GET as well. Patrick Breitenbach PayPal, Inc. Dev Net: https://www.paypal.com/pdn
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 1/10/2004 Posts: 2 Location: ,
|
I've had PayPal IPN service working for a few months now. All of a sudden, it stopped working on 1/7/2004. I'm also getting
java.security.cert.CertificateException: Could not find trusted certificate
Perhaps PayPal updated its server SSL certificate recently. Can PayPal provide a .cert file we can import into our SSL key store? I've done this at work in the past when we had trouble connecting to providers/customer SSL servers.
J Servin
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 1/12/2004 Posts: 6 Location: ,
|
Hi,
We are also facing "javax.net.ssl.SSLHandshakeException: Could not find trusted certificate" from paypal IPN calling from 8th Jan 2004, as our customers are complain that their status set with paid but we are not receiving payments.
we are getting Exception at this code
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
we have tried with this following but still exception at setting property at "javax.net.ssl"
Security.addProvider ( new com.sun.net.ssl.internal.ssl.Provider()); System.setProperty("javax.net.debug","all"); System.setProperty("java.protocol.handler.pkgs","javax.net.ssl"); // System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
As we are facing severe problem with our Customer Relationship any one's reply will be appreciated very much!!!.
Thanks & Regards,
Parthiban Palani, Akmin Tech.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 1/12/2004 Posts: 6 Location: ,
|
hi, Thanks Patrick.
Parthiban Palani,
Akmin Tech.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 1/21/2004 Posts: 3 Location: ,
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"> Originally posted by Shannon[br]It is a problem with Verisign. It is net wide. http://verisign.com/corp...20040109.html?sl=070807
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"> I'm not sure this is the problem. There's another post I found on this site where the guy posted this link... http://sunsolve.sun.com/....pl?doc=fsalert%2F57436
After reading the article I did what it said - I upgraded to jdk1.4.2_03 and that worked - much more simple than all the other stuff I was trying. Above-Avg Joe ;-)
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 2/26/2004 Posts: 7 Location: ,
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"> I'm not sure this is the problem. There's another post I found on this site where the guy posted this link... http://sunsolve.sun.com/....pl?doc=fsalert%2F57436
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"> This is absolutely right. The issue is that the certs distributed with the JVM expired, so you can either upgrade your JVM, or you can update the certs in your keystore. There are instructions for both (follow the link above). If you are like most people and your site is hosted with someone else (where you may not have much choice about changes to the JVM or the keystore!), there are two more options: 1) Simply use the http address and avoid SSL altogether. The only problem - of course you reduce your security level, and take the risk (slim, but it's there) that your POST will be sniffed. 2) You can disable cert validation in your Java code, by replacing the TrustManager with an "all-trusting" version. This is my current solution. It does not risk security (since you KNOW which URL you're connecting to, and you know that PayPal's cert is valid!). Here's the code (not sure how this will look in the forum...): private static void disableCertCheck() { // make a naive trust manager TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers(){ return null; } public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {} public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {} } }; // install it try { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) {} }
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 3/5/2004 Posts: 4 Location: ,
|
to see how to manage the truststore for this single connection without altering your global JVM truststore, see http://www.paypaldev.org/topic.asp?TOPIC_ID=9272
Reach me securely via: https://www.privasphere.com/e.do?email=hauser@acm.org
|
|
|
|
Rank: Starting Member
Groups:
Joined: 9/10/2009 Posts: 3
|
Try flitronn. <a href= http://en.wikipedia.org/wiki/Rape > Rape </a> Rape [link http://en.wikipedia.org/wiki/Rape] Rape [/link] <a href= http://daughter-incest.enic.nl/ > gay incest stories </a> gay incest stories [link http://daughter-incest.enic.nl/] gay incest stories [/link] <a href= http://rapesex.enic.nl/ > forced sex fantasy </a> forced sex fantasy [link http://rapesex.enic.nl/] forced sex fantasy [/link] <a href= http://rape-porn.enic.nl/ > anal rape </a> anal rape [link http://rape-porn.enic.nl/] anal rape [/link] <a href= http://amateur-incest.enic.nl/ > incest mom </a> incest mom [link http://amateur-incest.enic.nl/] incest mom [/link] <a href= http://rape-porn.enic.nl/ > forced oral sex </a> forced oral sex [link http://rape-porn.enic.nl/] forced oral sex [/link] <a href= http://en.wikipedia.org/wiki/Incest > Incest </a> Incest [link http://en.wikipedia.org/wiki/Incest] Incest [/link]
|
|
|
|
Guest
|