Problem using multiple Client Certificates

Hi folks, I had (mistakenly) posted an earlier version of this question to the crypto forum.
My problem is that I have multiple client certs in my keystore, but only one is being used as the selected certificate for client authentication for all connection�s. So, one connection works fine, the rest fail because the server doesn�t like the client cert being presented.
I have been trying to get the JSSE to select the proper client certificate by making use of the chooseClientAlias method. (init the SSL context with a custom key manager that extends X509ExtendedKeyManager and implements the inherited abstract method X509KeyManager.chooseClientAlias(String[], Principal[], Socket))
But, still no luck.. the JSSE is not calling in to the my version of chooseClientAlias, and it just keeps presenting the same client certificate.
No clue why, any thoughts on how to get the JSSE to call my version of chooseClientAlias?
Thanks!
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(createCustomKeyManagers(Keystore, KeystorePassword),
            createCustomTrustManagers(Keystore, KeystorePassword),null);
SSLSocketFactory factory = sslContext.getSocketFactory();
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
urlConn = (HttpsURLConnection) conn;
urlConn.setSSLSocketFactory(factory);
BufferedReader rd = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
     System.out.println(line);  }
public class CustomKeyManager extends X509ExtendedKeyManager
    private X509ExtendedKeyManager defaultKeyManager;
    private Properties serverMap;
    public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
        SocketAddress socketAddress = socket.getRemoteSocketAddress();
        String hostName = ((InetSocketAddress)socketAddress).getHostName().toUpperCase();
        String alias = null;
        if(serverMap.containsKey(hostName)){
            alias = serverMap.getProperty(hostName.toUpperCase());
            if(alias != null && alias.length() ==0){
                alias = null; }
        else {
            alias = defaultKeyManager.chooseClientAlias(keyType, issuers, socket);
        return alias;
.

Topic was correctly answered by ejp in the crypto forum..
namely: javax.net.ssl.X509KeyManager.chooseClientAlias() is called if there was an incoming CertificateRequest, according to the JSSE source code. If there's an SSLEngine it calls javax.net.ssl.X509ExtendedKeyManager.chooseEngineClientAlias() instead.*
You can create your own SSLContext with your own X509KeyManager, get its socketFactory, and set that as the socket factory for HttpsURLConnection.*
Edited by: wick123 on Mar 5, 2008 10:26 AM

Similar Messages

  • JAX-WS: How to choose from multiple client certificates on the fly?

    I have a webapp that is calling a web service supplied by a vendor. The vendor requires the use of client certificates for authentication, and I have successfully called their service using the PKCS#12 keystore they gave us with JAX-WS 2.2 using code like this:
        System.setProperty("javax.net.ssl.keyStore", "myKeyStore.p12");<br />
        System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");<br />
        System.setProperty("javax.net.ssl.keyStorePassword", "password");The problem is, my webapp will be supporting multiple business units, and the vendor differentiates between our business units by issuing separate certificates for each. So I'm in a quandary: I have four PKCS#12 files, one per business unit, and my webapp will need to decide which one to use at runtime. Moreover, this webapp could be heavily used by many simultaneous users, and thus more than one of the certs may need to be used at the same time. Hence whatever the solution is, it will need to be thread safe.
    I was able to combine all four certificates into a single JKS keystore using the JDK 1.6 "keytool -importkeystore" operation with each of my four PKCS#12 certs, so I now have all four in a single JKS keystore. The above code then becomes this:
        System.setProperty("javax.net.ssl.keyStore", "myKeyStore.jks");<br />
        System.setProperty("javax.net.ssl.keyStoreType", "jks");<br />
        System.setProperty("javax.net.ssl.keyStorePassword", "password");So my challenge now is to programatically select between the four possible certs when calling the vendor's web service. How do I do that with JAX-WS RI 2.2?
    Thanks,
    Bill

    Just to close the loop on this (and for the next person trying to figure out how to do it), I was able to [extend X509KeyManager as described in Alexandre Saudate's blog|http://alesaudate.com/2010/08/09/how-to-dynamically-select-a-certificate-alias-when-invoking-web-services/] . I was then able to set the com.sun.xml.ws.developer.JAXWSProperties.SSL_SOCKET_FACTORY on my JAX-WS request context to use my custom SSLSocketFactory, and it works like a charm!
    Thanks,
    Bill

  • Problem Using Multiple With Statements

    I'm having a problem using multiple WITH statements. Oracle seems to be expecting a SELECT statement after the first one. I need two in order to reference stuff from the second one in another query.
    Here's my code:
    <code>
    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '40'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '100'
    END first_term,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '100'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '160'
    END second_term
    FROM robinst
    WHERE robinst_aidy_code = :aidy)
    /*Use terms from calculate_terms to generate attendance periods*/
    WITH gen_attn_terms AS
    SELECT
    CASE
    WHEN first_term LIKE '%60' THEN 'Fall '||substr(first_term,0,4)
    WHEN first_term LIKE '%20' THEN 'Spring '||substr(first_term,0,4)
    END first_attn_period,
    CASE
    WHEN second_term LIKE '%60' THEN 'Fall '||substr(second_term,0,4)
    WHEN second_term LIKE '%20' THEN 'Spring '||substr(second_term,0,4)
    END second_attn_period
    FROM calculate_terms
    SELECT *
    FROM gen_attn_terms
    <code>
    I get ORA-00928: missing SELECT keyword error. What could be the problem?

    You can just separate them with a comma:
    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '40'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '100'
    END first_term,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '100'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '160'
    END second_term
    FROM robinst
    WHERE robinst_aidy_code = :aidy),
    /*Use terms from calculate_terms to generate attendance periods*/
    gen_attn_terms AS
    SELECT
    CASE
    WHEN first_term LIKE '%60' THEN 'Fall '||substr(first_term,0,4)
    WHEN first_term LIKE '%20' THEN 'Spring '||substr(first_term,0,4)
    END first_attn_period,
    CASE
    WHEN second_term LIKE '%60' THEN 'Fall '||substr(second_term,0,4)
    WHEN second_term LIKE '%20' THEN 'Spring '||substr(second_term,0,4)
    END second_attn_period
    FROM calculate_terms
    )Not tested because there are no scripts.

  • Problem using multiple contexts in same thread

    Hello,
    I am having problem using multiple contexts in the same thread. Here is the scenario:
    front-end is calling a ejb1 with a user1 and password. Ejb1 is then calling ejb2
    using user2 and password. I am getting security exception when calling ejb2 with
    the message user1 is not authorized. Looking at the documentation, context 2 should
    be pushed on stack on top of context 1 and context 2 should then be used until
    context.close() is called. It looks like this is not the case in this scenario?
    Regards,
    Jeba Bhaskaran

    I have the GTX670. So pretty much the same.
    When I go to  Edit>Preferences>Playback I see:
    When I select the monitor I am not currently using for Premiere Pro, the Program Monitor shows up full size at 1920X1080 in that monitor.
    While that may not help you, at least you know a similar card can do the job and you know that it should work.. What happens if you drop down to two monitors? Will it work then?
    Also, have you performed the hack that allows Premiere Pro to use the card since that card is not in the file? I have no idea if that is relevant at all, by the way. It is just an attempt at getting our systems to work the same way.

  • Problem using CORBA clients with RMI/EJB servers..!!!???

    Hi,
    I have a question on using EJB / or RMI servers with CORBA clients using
    RMI-IIOP transport, which in theory should work, but in practice has few
    glitches.
    Basically, I have implemented a very simple server, StockTreader, which
    looks up for a symbol and returns a 'Stock' object. In the first example, I
    simplified the 'Stock' object to be a mere java.lang.String, so that lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case 1) and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
    But the problem arises when I tried using the RMI server (via IIOP) with the
    CORBA client, when the client tries to narrow the object ref obtained from
    the naming service into the CORBA idl defined type (StockTrader) it ends up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a PortableRemoteObject derived
    class, to make it IIOP compliant), and then the server to register the stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming =NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ": " +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to register the RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref name (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the naming
    service, the operation StockTraderHelper.narrow() fails in the segment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registered in a CORBA
    server (as opposed to an RMI server), but works correctly with no casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

    On the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
    include the examples.
    "<=one way=>" wrote:
    With reference to your and other messages, it appears that one should not
    expect that WLS RMI-IIOP will work in a complex real-life system, at least
    not now. In other words, support for real-life CORBA clients is not an
    option in the current release of WLS.
    TIA
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
    needs for uses who need to use IDL to talk to the Weblogic server,
    generically. This example illustrates the simplest connectivity; it does not
    address how
    to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
    this topic either, a point which is telling if all the less happy to hear.
    For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
    correct; better examples are forth coming.
    Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
    programming model is busted; busted in the sense that there are no C++
    libraries to support the EJB model, and busted in the sense that there is
    simply no
    support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
    in productive ways.
    For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
    dispatch IIOP request into RMI server objects. The way I look at it is this:
    it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
    practically nothing to do with CORBA.
    ST wrote:
    Eduardo,
    Can you give us more details about the comment below:
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
    use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
    implementation. We
    don't need a "HelloWorld" example, we need a concrete serious example(fully
    tested and seriously documented) that works so that we can get a betteridea
    on how to integrate CORBA and EJB.
    Thanks,
    Said
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    Please post request to the news group...
    As I said, you must separate the idl related classes (class files and
    java
    files) from the rmi classes... in the rmic step, you must set a newtarget
    (as you did), emit the java files into that directory (it's not clearyou
    did this), then remove all the rmi class files from the class path... ifyou
    need to compile more classes at that point, copy the java files to theidl
    directly is you must, but you can not share the types in any way.
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
    an idl client in java to work.
    Harindra Rajapakshe wrote:
    Hi Eduardo,
    Thanks for the help. That is the way I compiled my CORBA client, by
    separating the IDL-generated stubs from the RMI ones, but still I
    get a
    CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
    Here's what I did;
    + Define the RMI interfaces, in this case a StockTrader interface.
    + Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
    making
    it IIOP compliant
    + Implemnnt an RMI server, and compile using JDK1.2.2
    + use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
    utility rmic;
    rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
    + generate Java mappings to the IDL generated above, using RMI-IIOPplugin
    util,
    idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
    This creates source for the package stock and also
    org.omg.CORBA.*
    package, presumably IIOP type marshalling
    + compile all classes generated above using JDK1.2.2
    + Implement client (CORBA) using the classes generated above, NOTthe
    RMI
    proxies.
    + start RMI server, with stockTrader server obj
    + start tnameserv
    + start CORBA client
    Then the client errors when trying to narrow the obj ref from the
    naming
    service, into the CORBA IDL defined interface using,
    org.omg.CORBA.Object obj =naming.resolve(nn);
    StockTrader trader =StockTraderHelper.narrow(obj); // THIS
    ERRORS..!!!
    throwing a CORBA.BAD_PARAM exception.
    any ideas..?
    Thanks in advance,
    -hari
    ----- Original Message -----
    From: Eduardo Ceballos <[email protected]>
    Newsgroups: weblogic.developer.interest.rmi-iiop
    To: Hari Rajapakshe <[email protected]>
    Sent: Wednesday, July 26, 2000 4:38 AM
    Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
    Please see the post on june 26, re Errors compiling... somewherein
    there,
    I suspect, you are referring to the rmi class file when you are
    obliged
    to
    completely segregate these from the idl class files.
    Hari Rajapakshe wrote:
    Hi,
    I have a question on using EJB / or RMI servers with CORBA
    clients
    using
    RMI-IIOP transport, which in theory should work, but in practice
    has
    few
    glitches.
    Basically, I have implemented a very simple server,
    StockTreader,
    which
    looks up for a symbol and returns a 'Stock' object. In the firstexample, I
    simplified the 'Stock' object to be a mere java.lang.String, so
    that
    lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case
    1)
    and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
    But the problem arises when I tried using the RMI server (via
    IIOP)
    with
    the
    CORBA client, when the client tries to narrow the object ref
    obtained
    from
    the naming service into the CORBA idl defined type (StockTrader)
    it
    ends
    up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending
    java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a
    PortableRemoteObject
    derived
    class, to make it IIOP compliant), and then the server to
    register
    the
    stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation
    class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming=NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ":"
    +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to
    register
    the
    RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref
    name
    (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the
    naming
    service, the operation StockTraderHelper.narrow() fails in thesegment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the
    type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registeredin a
    CORBA
    server (as opposed to an RMI server), but works correctly with
    no
    casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

  • Problem with Require Client Certificate on on IPlanet 6.0 server

    I installed client certificate. When I connect to the server using browser, I get following error........
    You are not authorized to view this page
    You might not have permission to view this directory or page using the credentials you supplied.
    How can I run the server in Verbose mode and see exactly why this error.
    Default error file does not have any information about this rejection.
    Thanks
    Krishna

    The message is cut and paste of what client (IE) shows on the browser.
    But the Server does not show any thing in it;'s log. I don't see any activity. I have Log Verbose On.
    If I change the client certificate on to off it works fine.
    The problem is only when the client certificate is on.
    The client certificate is created using Iplanet Certificate Server as well the server certificate also generated using Iplanet Certificate Server.
    In this case I am not trying to authenticate user in the client certificate just the client certificate is valid or not.
    Thanks for the reply.
    Regards
    Krishna

  • Problem with multiple client numbers from a view

    Hi Gurus,
    I have a problem with a view
    Creates a view with a UNION ALL stmt
    =====================================
    Create view vw_benifits
    as
    SELECT
         Client_num, -- can have multiple values like 200,201,250
         PERNR,     
         OBJPS,     
         ENDDA,     
         BEGDA,
         AEDTM,     
         UNAME,
         COB_MNTH_AMT
    FROM
         STG_SAP_PA9211_TB
    UNION ALL
    SELECT
         null, -- no client number for legacy data
         PERNR,     
         OBJPS,     
         ENDDA,     
         BEGDA,
         AEDTM,     
         UNAME,
    COB_MNTH_AMT
    from
         LEG_STG_SAP_PA9211_TB;
    ==============================
    The second table contains legacy data (LEG_STG_SAP_PA9211_TB). The first table now contains multiple client data (ie the client_num can be 201,202,250 like that.
    Now if the users qery the view they will only get that clients data.
    eg selet * from vw_benifits where client_num=250 results only client 250 data. But I want to add the legacy data also with that.
    I don't want to propose
    selet * from vw_benifits where client_num in (250,NULL) since the users will be confused.
    Is there any other way to do this . my requirement is like
    If they query
    select * from vw_benifits where client_num=250, the data should include all the records satisfying client=250 + the records from the legacy data. The view need to be created like that.
    Appreciate your help
    Deepak

    Hi Thanks for the suggestion.
    But I am not sure this may work for me. Here my users may not be able to use that since they don't know Oracle.
    I want to hide that details from them
    They may just issue a statement like this
    select * from vw_benifits where client_num =250
    Or
    select * from vw_benifits where client_num =400 . But both times I need to show them the data from the legacy table.
    Deepak

  • 2-way SSL and access control using the client certificate

    Hi,
    I'd like to configure WLS 8.1 so that the server will use the client identity extracted from the client certificate to determine whether permissions should be granted. I am having some problems.
    Details: The client can be either a Web service or a web application. The steps for authentication and authorization should be:
    - The client sends a request to an Apache server (DMZ) which will then be forwarded to WLS.
    - The client's identity, common name from the X.509 certificate, is mapped to the "username" (using WLS default identity assertion provider).
    - Validate whether the client should be trusted (via the list in the trusted credentials)
    - Check whether the resource should be granted based on the "username".
    The on-line manual says
    "If the Web browser or Java client requests a WebLogic Server resource protected by a security policy, WebLogic Server requires that the Web browser or Java client have an identity."
    "The user corresponding to the Subject's Distinguished Name (SubjectDN) attribute in the client's digital certificate must be defined in the server's security realm; otherwise the client will not be allowed to access a protected WebLogic resource. For information on configuring users on the server, see Creating Users in Managing WebLogic Security."
    So the questions I have are:
    - If the client identity is certificate based, why should we configure users with the "user name" and "password"? How can we get around it?
    - Once I defined the security condition for my app to use "user name of the caller," a default username and password prompt automatically popped up.
    Apparently, the SSL mutual authentication configuration and the default authentication provider to use the X.509 type didn't take any effect.
    - Without defining the security policy for the application, the debugging messages show that
    getRoles(): input arguments: subject:0
    Entitlement - <Role:Annonymous with expr:Grp(everyone)>
    Any suggestions? Thanks.

    Hi,
    I am trying to use 2 way ssl using webservices client , here is my code :
    AxisProperties.setProperty("org.apache.axis.components.net.SecureSocketFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    // clientCredentialFile stores in PEM format the public key and
    // all the CAs associated with it + then the private key. All this in // a concatenated manner
    FileInputStream clientCredentialFile = new FileInputStream ("C:\\sslcert\\client-pub3.pem");
    // private key password
    String pwd = "password";
    adapter.loadLocalIdentity(clientCredentialFile, pwd.toCharArray());
    adapter.setVerbose(true);
    adapter.setTrustedCertificatesFile("C:\\certificate\\server\\server.jks");
    adapter.setStrictCheckingDefault(false);
    factory.setDefaultAdapter(adapter);
    factory.setUseDefaultAdapter(true);
    boolean idAvailability = false;
    UNSLocator locator = new UNSLocator();
    URL portAddress = new URL("https://localhost:7002/smuSSWeb/UNSResponse.xml");
    UNSPort unsprt = locator.getUNSPort(portAddress);
    idAvailability = unsprt.isIDAvailable("Yulin125", "C");
    System.out.println("Got from method :"+idAvailability);
    After runing this code i am getting the following exception :
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.net.SocketException: Software caused connection abort: socket write error
    faultActor:
    faultNode:
    faultDetail:
    I am using .pem (clientsigned,clientinter,clientroot, root-key) files for client authentication and i am using server.jks as a keystore for my server authentication.Once i run this code , i am able to present the server certificate chain to the client but i am not able to present the client certificate chain to server.
    I am stuck with for quite sometime.
    Some insight needed from the guru's

  • Problem in reading client certificate

    Hi,
    I am developing an web app. where client will use smart card for authentication.
    And server will read the clients certificate. All the application will run in https.
    So please guide me to develop such a system. I am using tomcat 6x and have created a server certificate by keytool.
    I am not using openssl.
    Please help me....
    Thanx in advance.

    hi
    when you pass the manual entry posting date will be 31.03.2009 and period will be 13 because when we close the year still open 4 special period to post further entries.
    Regards
    Tanmoy

  • How to use multiple clients within JCO?

    Hi,
    I'm pretty new to configuring Web Dynpro's with it's JCO connections. I have the following question.
    We are using one portal (SAP EP 6.0_640 SP15) and one R/3 system (SAP ECC 5.0) with multiple clients (multiple customers who are all using the same portal).
    Do I have to deploy a web dynpro for each client and maintain it's JCO connection for each client?
    Or is there another way how I can set this up?
    Thanks in advance.
    Kind regards,
    Dave Arends

    Hi Dave,
    <b><i>Do I have to deploy a web dynpro for each client and maintain it's JCO connection for each client?
    Or is there another way how I can set this up?</i></b>
    You dont need to deploy a web dynpro for each client . You can use same JCO connection for multiple User ID's  ( multiple Clients mean multiple user ID's on the same portal ).
    If this is the case then single JCo connection is enough to pull data from R/3 and show on portal page .
    Thanks,
    Nanda

  • BC4J Problem using multiple EntityObjects in a single ViewObject

    Hi,
    I have found a bug while using multiple EntityObjects in a single ViewObject.
    Considere the following example:
    Table A:
    A_ID
    Table B:
    B_ID
    A_ID (FK) NULLABLE
    TABLE C:
    C_ID
    B_ID (FK) NULLABLE
    For each table there is a corresponding EntityObject : AEntity, BEntity and CEntity.
    Now building a ViewObject based on CEntity, BEntity and AEntity, where AEntity and BEntity are referenced via their corresponding associtaions, the following problem occurs:
    1. As long as both IDs are not NULL everything works fine, but when I set the B_ID attribute of CEntity to NULL I receive a NullPointerException with the detail "null".
    2. If the attribute A_ID of BEntity is NULL the values based on AEntity are not updated at all (they keep the value they had for the last row).
    Any information or feedback on this issue would be very welcome!
    Regards
    Frank

    Here's a sample code that works for a
    LineItem->OrdView->CustomerView case,
      public void setOrdId(Number value)
        //set the boolean if there's a current order.
        boolean hasOrd = (getEntity(1) != null);
        setAttributeInternal(ORDID, value);
        //after the OrdID is set, check if there's a valid Ord Entity in this row.
        if (hasOrd && getEntity(1) == null)
          //if not, then set the Customer Entity to null as well.
          super.setEntity(2, null);
          LinesViewImpl vo = (LinesViewImpl)getViewObject();
          //And force a RowUpdated event for "customer-entity-usage-attributes".
          vo.notifyRowUpdated(findRowSetForRow(null), new oracle.jbo.Row[] {this}, new int[]{6,7});
      } Note that in the above, you have to "override" notifyRowUpdated method in the ViewObjectImpl subclass, so that it's available to the LineViewRowImpl subclass. You can do this
    globally by creating a custom subclass of ViewObjectImpl that all the VOs in your application "extends".

  • Problem using instant client with Win 7

    Hi,
    I have a Powerbuilder application that runs very well with Win XP and Oracle client 8 to 10.
    With new computers (Win 7), we try to use instant client... but there are problems with accents ! In fact, all accents are replaced by a "¿" in the database.
    It only appears when we are using our programs from a Win 7 machine with instant client.
    Do you know if there is something to configure to solve this problem ?
    Best regards.

    user1931557 wrote:
    Hi,
    I have a Powerbuilder application that runs very well with Win XP and Oracle client 8 to 10.
    With new computers (Win 7), we try to use instant client... but there are problems with accents ! In fact, all accents are replaced by a "¿" in the database.
    It only appears when we are using our programs from a Win 7 machine with instant client.
    Do you know if there is something to configure to solve this problem ?
    Best regards.
    If the characters only appear on certain clients, then they are NOT being "replaced ... in the database".  What you are seeing is an issue with presentation, not data.

  • System Landscape using multiple clients scenario for BW

    Hi Friends,
    I have a scenario where I want to use multiple BW clients based on single server.
    I have made client copy of the development server and want to transport the objects
    to the target clients.
    I am aware that such a scenario works fine in R/3 and infact i have used it
    .But in BW when i hit RSA1 I  get an error message "you can only use client(010)"-my development client of which copy was made.
    The client copy system is 102.
    Now I read a thread on sdn which said change client entry in RSADMINA table .I changed it ,but I think its cross client table and hence RSA1 is neither workinging in client copy or the parent system.I reverted back entry in client 102 and saw that development client working again fine like before.(also RSADMINA) value changed in 010.
    I have tried to fix it by creating appropriate mappings using SCC4/BD54/SALE/WE20/RZ10
    .Also created mapping WE20 for Partner profile and assigned the logica system.
    Is it possible to have such a system landscape?
    Can anyone give some useful suggestions?

    Hi..thanks to all of you....
    I think this thing boils down to table RSADMINA where you maintain entry for your client.
    The primary key there is 'Customizing ID' and when you specify there "BW" .You can't make another entry for another MANDT with another customizing id.
    Whenever u login to any other client and you change entry of MANDT it is going to be reflected to all the clients and thats what is the issue.So you can't mantain mulitple entries as you can't enter two customizing ids. there.
    Infact there are many reasons in the background as well which the sap note mentions like common number ranges..etc.
    Lastly ..Ofcourse as Siggi said you can have another R/3 or CRM system etc on the same server but no two BW clients.I think SAP should not allow client copy for BW on the same server..it will help some bad efforts
    Thanks for the support everyone.
    Regards,
    Rakesh
    Edited by: Rakesh Kumar on Jun 15, 2009 12:08 PM

  • Problems using multiple joins for search

    I am new to dreamweaver and coding and I am battling to get my head around joining tables and using multiple joins to create a search result recordset.
    I have a the following tables setup;
    Venues table
    venueID
    name
    category (text)
    city
    provinceID (numeric)
    country
    maxcapacity
    Province table
    provinceID
    province (text)
    Category Table
    categoryID
    category (text)
    Max Conference Table
    conferencefacilitiesID
    venueID
    maxcapacity
    I am passing the search $_POST variables via a form and displaying it in a results page.
    I have successfully done the search using only one table the problem results in using multiple joins. I cam not sure of the syntax to use but have successfully created the results page, using the outer join to link the province, category and maxcapacity to the venues table. Not all the venues have conferencing so I think need to use outer join for conferencing.
    I can't seem to access the search and not sure if I can use the WHERE command to set varialbe 'category' = varCategory 
    Below is my code which doesn't work;
    SELECT wp_dbt_venues.venuesID, wp_dbt_venues.name, wp_dbt_venues.category, wp_dbt_venues.province, wp_dbt_venues.city, wp_dbt_province.provinceID, wp_dbt_province.province, wp_dbt_conferencefacilties.venueid, wp_dbt_conferencefacilties.maxcapacity
    FROM ((wp_dbt_venues LEFT OUTER JOIN wp_dbt_province ON wp_dbt_venues.province = wp_dbt_province.provinceID)  LEFT OUTER JOIN wp_dbt_conferencefacilties ON wp_dbt_venues.venuesID = wp_dbt_conferencefacilties.venueid)
    WHERE 'category'=varCategory
    I would like to get on variable working and then expand onto the others like WHERE maxcapacity < varCapacity

    Hi bregent
    Thank you for all the help, below is the code. I have clened it up as best I could as dreamweaver seems to add recordset everytime I edit it. I then have to delete the old code. It also seems adds a totalRows variable and moves one of the runtime variables to the totalRows variable. Its all very confusing but its working.
    Results Page
    <?php require_once('Connections/tova.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if (isset($_POST['delegates'])) {
      $varDel_results = $_POST['delegates'];
    $varProv_results = "-1";
    if (isset($_POST['province'])) {
      $varProv_results = $_POST['province'];
    $varCat_results = "-1";
    if (isset($_POST['category'])) {
      $varCat_results = $_POST['category'];
    mysql_select_db($database_tova, $tova);
    $query_results = sprintf("SELECT wp_dbt_venues.venuesID, wp_dbt_venues.name, wp_dbt_venues.category, wp_dbt_venues.province, wp_dbt_venues.city, wp_dbt_province.provinceID, wp_dbt_province.province, wp_dbt_conferencefacilties.venueid, wp_dbt_conferencefacilties.maxcapacity FROM ((wp_dbt_venues LEFT OUTER JOIN wp_dbt_province ON wp_dbt_venues.province = wp_dbt_province.provinceID)  LEFT OUTER JOIN wp_dbt_conferencefacilties ON wp_dbt_venues.venuesID = wp_dbt_conferencefacilties.venueid) WHERE wp_dbt_venues.category = %s AND wp_dbt_venues.province = %s AND wp_dbt_conferencefacilties.maxcapacity < %s", GetSQLValueString($varCat_results, "text"),GetSQLValueString($varProv_results, "int"),GetSQLValueString($varDel_results, "int"));
    $results = mysql_query($query_results, $tova) or die(mysql_error());
    $row_results = mysql_fetch_assoc($results);
    $totalRows_results = mysql_num_rows($results);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <p>Search Results</p>
    <table width="200" border="1">
      <tr>
        <td> </td>
        <td>Name</td>
        <td>Category</td>
        <td>City</td>
        <td>Province</td>
        <td>Delegates</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_results['venuesID']; ?></td>
          <td><?php echo $row_results['name']; ?></td>
          <td><?php echo $row_results['category']; ?></td>
          <td><?php echo $row_results['city']; ?></td>
          <td><?php echo $row_results['province']; ?></td>
          <td><?php echo $row_results['maxcapacity']; ?></td>
        </tr>
        <?php } while ($row_results = mysql_fetch_assoc($results)); ?>
    </table>
    <p> </p>
    </body>
    </html>
    <?php mysql_free_result($results);
    ?>
    Search Page
    <?php require_once('Connections/tova.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_tova, $tova);
    $query_category = "SELECT category FROM wp_dbt_categories ORDER BY category ASC";
    $category = mysql_query($query_category, $tova) or die(mysql_error());
    $row_category = mysql_fetch_assoc($category);
    $totalRows_category = mysql_num_rows($category);
    mysql_select_db($database_tova, $tova);
    $query_province = "SELECT * FROM wp_dbt_province ORDER BY province ASC";
    $province = mysql_query($query_province, $tova) or die(mysql_error());
    $row_province = mysql_fetch_assoc($province);
    $totalRows_province = mysql_num_rows($province);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Search</title>
    </head>
    <body>
    <p><strong>Advanced Search</strong></p>
    <form action="results.php" method="post" name="form1" target="_blank" id="form1">
      <p>
        <label>Category
          <select name="category" id="category">
            <?php
    do { 
    ?>
            <option value="<?php echo $row_category['category']?>"<?php if (!(strcmp($row_category['category'], $row_category['category']))) {echo "selected=\"selected\"";} ?>><?php echo $row_category['category']?></option>
            <?php
    } while ($row_category = mysql_fetch_assoc($category));
      $rows = mysql_num_rows($category);
      if($rows > 0) {
          mysql_data_seek($category, 0);
                $row_category = mysql_fetch_assoc($category);
    ?>
          </select>
        </label>
      </p>
      <p>
        <label>Province
          <select name="province" id="province">
            <?php
    do { 
    ?>
            <option value="<?php echo $row_province['provinceID']?>"<?php if (!(strcmp($row_province['provinceID'], $row_province['provinceID']))) {echo "selected=\"selected\"";} ?>><?php echo $row_province['province']?></option>
            <?php
    } while ($row_province = mysql_fetch_assoc($province));
      $rows = mysql_num_rows($province);
      if($rows > 0) {
          mysql_data_seek($province, 0);
                $row_province = mysql_fetch_assoc($province);
    ?>
          </select>
        </label>
      </p>
      <p>
        <label>Delegates
          <input name="delegates" type="text" id="delegates" value="" />
        </label>
      </p>
      <p>
        <label>
          <input type="checkbox" name="Facilities" value="golf" id="Facilities_0" />
          Golf</label>
        <br />
        <label>
          <input type="checkbox" name="Facilities" value="game" id="Facilities_1" />
          Game</label>
        <br />
      </p>
      <p>
        <label>Search
          <input type="submit" name="submit" id="submit" value="Submit" />
        </label>
      </p>
    </form>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($category);
    mysql_free_result($province);
    ?>

  • Networking: problems servering multiple clients

    hi all
    i'm writing a simple client server system, with a multithread server, in order to serve multiple clients.
    the client's requests to connect to the server arrive to a port (ie 1025), and then the server, through a method returns to the client another port number, and then the comunication between them starts through the new port.
    all work very fine, but i tried, with 2 computers, to start two clients at the "same time" (with a gap of few milliseconds), and my system "crashes".
    i think that is a problem due to the second request that arrives while the comunication of the port from the server to the client happens.
    is there a way to "queue" the requests arriving to the 1025 port of my server?
    if i wasn't clear i can post some code
    thanx in advance
    sandro

    Yes, teh code I posted does nothing more then listen for incoming conections and create a new Thread wich gets the Socket created by the accept to play with. This will happen for any incoming connection on the right port and will always be handeled the same.
    As you'll see in the code i posted, there is some time between ServerSocket.accept returning a Socket and ServerSocket.accept being started again. This time shouldn't be to long to be sure the serversocket is listening for incoming connections when they arrive, so don't do to much inside the loop. If your system should handle a lot of connections simultaneously wou might have to optimise this be doing thing like having a few ClientThreads created allready to save the time of creating a new Thread. This becomes more important if you ClientThread is complex and slow to create. But when handelin less the say 25 clients you should be fine with this.

Maybe you are looking for

  • Migrating from iPhoto 5 to iPhoto '11

    I have experienced many problems moving from an iMac G5 PowerPC to a new iMac Intel, particularly in relation to iPhoto where I was using iPhoto 5 (Vn 5.0.4) on my old machine and iPhoto 11 (Vn9.1.1) on the new. Having decided against using  Migratio

  • BI XI 4.0 Cascading Style Sheets

    In BI XI 4.0 can you change the relative horizontal position of a table in the Cascading Style Sheets to always be 0 cm vs. 32 cm?

  • Photoshop CS6 is not recognizing my Epson Photo 1400 printer...how to fix?

    I cannot print anything from Photoshop CS6. When i try to print any / all types of files from Photoshop CS6 to my Epson Photo 1400 printer, I get the following error message: "There was an error opening your printer. Printing functions will not be av

  • Changing cursor when rollover Jbutton

    hi All...i need help i want to change the cursor when i move my mouse over the button into hand cursor, then when the button being pressed, cursor change to Wait cursor here code of mine.. import java.awt.Color; import java.awt.Cursor; import java.aw

  • Can we apply Dense Rank

    Hi All, I am working on Oracle BI Publisher. Can we apply Dense Rank on a column directly in the template? I don't want to change the total query for this, is there any way to do in template? if yes please tell me how can we do. Any suggestion would