Keystores and Certs etc

Hi, we've got a webapp running in Tomcat. It makes a call (using HttpUrlConnection) to an external site using HTTP. We're getting this in the logs:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetFrom what I've read, this is usually because the external site's public key isnt in the keystore. So, I've (hopefully) found the correct keystore and imported the public keys. But I still get the same error.
So, I wrote some basic test programs, using HttpUrlConnection like this:
URL url = new URL(address);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.connect();and also for good measure using SSLSockets
SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(host, port);I was expecting to see the same problem on my own PC here, but both connection methods work fine... I thought my code would fail until I manually imported the site's certificates into my keystore (I've been testing with HTTPS sites that my PC never seen before)
Any ideas what could be causing the original exception if it's not a missing public key as I originally thought?
Thanks

Hi sdf_iain, and a warm welcome to the forums!
I'm on Leopard at the moment, but in fact, the etc folder is an Alias here, and identical in content to the private/etc folder!

Similar Messages

  • Problem with Java keystore and certificates (unable to find valid cert path

    Our program is made so that when a certificate is not signed by a trusted Certification Authority, it will ask the user if he/her wishes to trust the certificate or not. If they decide to trust the certificate, it will accept the self signed certificate and import it into the keystore and then use that certificate to log the user in. This works fine. It will import the certificate into the keystore and use the specified ip address to establish a connection with the LDAP server (Active Directory in our case) and authenticate properly. However, the problem arises when we then try and connect to a different ip address (without restarting tomcat, if we restart tomcat, it works fine...). It imports the certificate into the keystore fine, but always gives the exception
    "Root exception is 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"
    and does not authenticate with our LDAP server (which is Active Directory). The problem seems to be that it is no longer looking at the System.setProperty("javax.net.ssl.trustStore", myTrustStore);
    I have tried multiple times to just reset this property and try and "force" it to read from my specified trust file when this error happens. I have also imported the certificates directly into the <java_home>/jre/lib/security/cacerts and <java_home>/jre/lib/security/jssecacerts directories as the java documentation says that it will look at those directories first to see if it can find a trusted certificate. However, this does not work either. The only way that I can get this to work is by restarting tomcat all together.
    If both of the certificates are already in the keystore before tomcat is started up, everything will work perfect. Again, the only problem is after first connecting to an IP address using TLS and importing the certificate, and then trying to connect to another IP address with a different certificate and import it into the keystore.
    One of the interesting features of this is that after the second IP address has failed, I can change the IP address back to the first one that authenticated successfully and authenticate successfully again (ie
    I use ip 1.1.1.1, import self signed certificate, authenticates successfully
    login with ip 2.2.2.2 import self signed certificate, FAILS
    login again with 1.1.1.1 (doesn't import certificate because it is already in keystore) successfully authenticates
    Also, I am using java 1.5.0_03.
    Any help is greatly appreciated as I've been trying to figure this out for over a week now.
    Thanks

    Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.

  • New Firefox ESR and certs

    Hi all: I downloaded and installed the newest Firefox ESR (31) this AM. I know that ZCM may not support this new version but I wanted to test it anyway. Right off Firefox refuses to load the ZCC website stating that the CA in untrusted. Gone in this new version of Firefox is the ability to bypass and load the CA anyhow. We use the internal ZCM CA rather than our external eDirectory CA. Should I change ZCM to use a new certificate minted by our eDir CA? If so, do I need to touch all the workstations in our zone?
    Thanks, Chris.

    What makes you think there is an issue about the ZCM Cert?
    It's more of a Firefox Bug Really, which fails to trust certs you have
    trueted that are self-signed vs using someone such as Verisign.
    This really impacts AD Certs, ZCM Certs, , eDir Certs, etc.. etc...
    In Short, There was a goof at Mozilla.....
    On 8/7/2014 8:26 AM, darryl82 wrote:
    >
    > I think that option will be disabled as of Firefox 33. is there a way to
    > fix the zenworks certs?
    >
    >
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Technical Support Engineer
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.

  • I really need emergency iphone help- please- it has gone into restoration mode and wont come out unless i click restore- if i do will i loose all my photos and videos etc? please help!!!

    i recently plugged my iphone4 into my laptop to sync, when i plugged it in, itunes told me that i needed to update my software, so i clicked up date and walked awayfrom my computer leaving it to do the rest, but by the time i came back to my laptop 2-3 hours later i had realized that it has run out of charge and because of it my phone had gone into retoration mode- and the only way to fix it was to press restore. what do i do? do i click restore or will that take my phone back to factory settings as i have a tonne of photos and videos etc that i have not backed up yet?
    what should i do anny coments or ideas please let me know!

    The first step in the upgrade process is a backup.
    Did iTunes not create a new backup when you first connected it?
    You really should be syncing your device and copying pictures off of it on a regular basis.
    Starting an upgrade without first syncing and copying the pictures off is not a bright idea.
    At this point, you only option is to restore.
    Also, in the future, ensure your laptop is plugged into external power before starting upgrades.

  • I have a macbook air - I am going to buy an iPad, will all my itunes and iPhoto etc be available on my iPad (how do I get it there)?

    I have a macbook air - I am going to buy an iPad, will all my itunes and iPhoto etc be available on my iPad (how do I get it there)?
    How do i check what of my info is on icloud (can iphoto be on icloud??) i have taken ten annual icloud subscription and i know my music is on it....

    You can download a complete iPad User Guide here: http://manuals.info.apple.com/en/ipad_user_guide.pdf
    Also, Good Instructions http://www.tcgeeks.com/how-to-use-ipad-2/
    Apple - iPad - Guided Tours
    http://www.apple.com/ipad/videos/
    Watch the videos see all the amazing iPad apps in action. Learn how to use FaceTime, Mail, Safari, Videos, Maps, iBooks, App Store, and more.
    How to - Articles & User Guides & Tutorials
    http://www.iphone-mac.com/index.php/Index/howto/id/4/type/select
    iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    You can download this guide to your iPad.
    iPad User Guide for iOS 5
    http://itunes.apple.com/us/book/ipad-user-guide-for-ios-5/id470308101?mt=11
     Cheers, Tom

  • We have multiple users, each with multiple devices, on 1 apple id - as we want to share music and ibooks etc.  We want the children to have access to the store, but with a financial limit. How do we do this?

    We have multiple users, each with multiple devices, on 1 apple id - as we want to share music and ibooks etc.  We want the children to have access to the store, but with a financial limit. How do we do this?

    Welcome to the Apple Community.
    That's simply not possible I'm afraid. You'd need to give them their own account and allowance or make it so you are required to be there to input the password when they wish to make a purchase.

  • I need help changing the account number my daughter uses for payment for her apps and itunes, etc. can anyone talk me through this.

    hi ,
    im just a mom, not very computer savy.....however, I need to change the payment method my daughter uses to purchase things on her ipad due to the fact that the current one is expiring. ie: for such things like songs and games, etc.
    I would appreciate any help as how to do so.
    THanks

    On a computer's iTunes you should be able to edit the payment info by going into the Store > View Account menu option (if you are not logged into the account that your daughter is using then Store > Sign menu option to log out of the currently logged in account ; that will then change to a Store > Sign In option so that you can log into her account) and log into the account (enter the account's password and click View Account on the popup)
    And on the account's details page there should be a payment link.
    If you are doing it on your iPad then tap on your id in Settings > iTunes & App Store (if not logged into her account then log out of your account via the popup that you get and then log in with her account) and tap on 'View Apple ID' on the popup and log into the account  - that should also give you a payments link on your account's page.
    Changing payment info : http://support.apple.com/kb/HT1918

  • When i tried to sync my new iPhone to Itunes, I accidentally clicked on sync with my ipod, instead of creating a new one. So now my iphone is the replica of my ipod, deleting my contacts and pictures etc. Is there a way to get it restored?

    When i tried to sync my new iPhone to Itunes, I accidentally clicked on sync with my ipod, instead of creating a new one. So now my iphone is the replica of my ipod, deleting my contacts and pictures etc. Is there a way to get it restored?

    Only if a backup of the iPhone with all that data on it exists.  If one does, restore the iPhone using that backup.

  • I want to upgrade my phone to the 4 or 4s.  My macs are still running Tiger.  If I bought an iPad 2, could I sync everything to it from the 4 without using a Mac at all, and then be able to iCloud my calendar and contacts, etc?

    I want to upgrade my phone to the 4 or 4s.  My macs are still running Tiger.  If I bought an iPad 2, could I sync everything to it from the 4 without using a Mac at all, and then be able to iCloud my calendar and contacts, etc?

    Radiation Mac wrote:
    And you must be using a recent version of iTunes on your iMac in order to activate the iPad,  So, no.
    You don't need a computer to activate a new iOS device anymore. Anything with iOS 5 can be activated over a WiFi network (or cellular if that applies).

  • Word has stopped working on my macbook air, i have used it before and powerpoint etc are all still working, but i can no longer open word or word files can anyone help?

    word has stopped working on my macbook air, i have used it before and powerpoint etc are all still working, but i can no longer open word or word files can anyone help?

    Hi Rachel,
    Have you tried reinstalling Microsoft Word? Have you tried reinstalling Office? Have you run any updates recently for Microsoft Office? There was one that came out this week. You may wish to ask this question over at the Microsoft Word forums, there's a good chance you'll get a better answer as well. This forum is primarily designed for the MacBook Air hardware and interoperability with OS X on a MacBook Air.
    http://support.microsoft.com/gp/cp_macoffice2008_master

  • I recently lost my windows laptop due to a virus. I had backed up all files onto a drive(files only). However no itunes playlists. i have all my playlists on my iphone and pics etc however when im trying to sync to my new computer itunes deletes all data

    I recently lost my windows laptop due to a virus. I had backed up all files onto a drive(files only). However no itunes playlists. i have all my playlists on my iphone and pics etc however when im trying to sync to my new computer itunes wants to  deletes all data off of my iphone so i click cancel
    i want to update to iOS 5 and still have itunes be able to copy my playlists from my iphone. for free. why does apple provide a recovery from iphone option?

    If you have a backup, restore the ENTIRE iTunes folder to the computer.  This restores the library and device association files.  If for some reason you chose to only back up the media and not the entire iTunes folder, then the only option is to let iTunes wipe the drive and re-sync.

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • I dropped my iPhone 4 in water and now it won't turn on at all, will i lose all of my data, for example my photos and messages etc? and is there any way you can back the phone up without having it switched on?

    I dropped my iPhone 4 in water and now it won't turn on at all, will i lose all of my data, for example my photos and messages etc? and is there any way you can back the phone up without having it switched on?

    If you had previously been backing up to iCloud (or a computer with iTunes), you would possibly have a backup.  That said, if you can't turn the phone on, you cannot create a backup of the device now.  Sorry.

  • Can't update iOS 8 on my iPhone5 through iTunes on Windows 8 (error 3004, 3194). Updated host file, opened port 80, 443; turned off security system and firewall, etc. But nothing works. How to solve this problem?

    Can't update iOS 8 on my iPhone5 through iTunes on Windows 8 (error 3004, 3194). Updated host file, opened port 80, 443; turned off security system and firewall, etc. But nothing works. How to solve this problem?

    Hi the_mad_movies,
    It seems like this article will be the best option for addressing this issue:
    Error 3194, Error 17, or "This device isn't eligible for the requested build"
    http://support.apple.com/kb/ts4451
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • I recently updated my ipad and then  I connected with my computer forn sync, not realising that I had a new version of itunes with none of my apps. Now I have lost allof the apps and books etc, that I had prurchased. How do I get them back?

    I recently updated my ipad and then  I connected with my computer for sync, not realising that I had a new version of itunes with none of my apps. Now I have lost all of the apps and books etc, that I had prurchased. How do I get them back?

    As long as the apps and ibooks are still available in the store, and you use the same iTunes account as you originally used to buy them, then you should be able to re-download them for free : http://support.apple.com/kb/HT2519

Maybe you are looking for