Examples of extendedOperation()


Examples of javax.naming.ldap.LdapContext.extendedOperation()

    public void testUnknownExtendedOperation() throws Exception
    {
        LdapContext ctx = ( LdapContext ) getWiredContext( ldapServer ).lookup( "ou=system" );
        try
        {
            ctx.extendedOperation( new UnknownExtendedOperationRequest() );
            fail( "Calling an unknown extended operation should fail." );
        }
        catch ( CommunicationException ce )
        {
            // expected behaviour
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

        env.put( "java.naming.provider.url", "ldap://localhost:" + getLdapServer().getPort() );
        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
        env.put( "java.naming.security.credentials", "secret" );
        env.put( "java.naming.security.authentication", "simple" );
        LdapContext ctx = new InitialLdapContext( env, null );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

        getLdapServer().reloadSslContext();

        // create a new secure connection
        ctx = new InitialLdapContext( env, null );
        tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

        LOG.debug( "About to get initial context" );
        LdapContext ctx = new InitialLdapContext( env, null );

        // Start TLS
        LOG.debug( "About send startTls extended operation" );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        LOG.debug( "Extended operation issued" );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

            LOG.debug( "About to get initial context" );
            LdapContext ctx = new InitialLdapContext( env, null );

            // Start TLS
            LOG.debug( "About send startTls extended operation" );
            StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
            LOG.debug( "Extended operation issued" );
            tls.setHostnameVerifier( new HostnameVerifier()
            {
                public boolean verify( String hostname, SSLSession session )
                {
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

    StartTlsResponse response = null;
    try {
      if (LdapProtocol.TLS.equals(Protocol)) {
        StartTlsRequest request = new StartTlsRequest();
        response = (StartTlsResponse) ctx.extendedOperation(request);
        response.negotiate();
        if (username != null && password != null) {
          ctx.addToEnvironment(Context.SECURITY_AUTHENTICATION,
              "simple");
          ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, username);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

        env.put( "java.naming.provider.url", "ldap://localhost:" + getLdapServer().getPort() );
        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
        env.put( "java.naming.security.credentials", "secret" );
        env.put( "java.naming.security.authentication", "simple" );
        LdapContext ctx = new InitialLdapContext( env, null );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here

Examples of javax.naming.ldap.LdapContext.extendedOperation()

        getLdapServer().reloadSslContext();

        // create a new secure connection
        ctx = new InitialLdapContext( env, null );
        tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here

Examples of org.jivesoftware.util.JiveInitialLdapContext.extendedOperation()

      if (followReferrals)
        Log.warn("\tConnections to referrals are unencrypted! If you do not want this, please turn off ldap.autoFollowReferrals");

      // Perform a StartTLS extended operation
      StartTlsResponse tls = (StartTlsResponse)
        context.extendedOperation(new StartTlsRequest());
     

      /* Open a TLS connection (over the existing LDAP association) and
         get details of the negotiated TLS session: cipher suite,
         peer certificate, etc. */
 
View Full Code Here

Examples of org.jivesoftware.util.JiveInitialLdapContext.extendedOperation()

            Log.debug("LdapManager: ... StartTlsRequest");
          }

          // Perform a StartTLS extended operation
          StartTlsResponse tls = (StartTlsResponse)
            ctx.extendedOperation(new StartTlsRequest());

          /* Open a TLS connection (over the existing LDAP association) and
             get details of the negotiated TLS session: cipher suite,
             peer certificate, etc. */
          try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.