00001 #include "orbsvcs/SSLIOP/SSLIOP_Connector.h"
00002 #include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
00003 #include "orbsvcs/SSLIOP/SSLIOP_Profile.h"
00004 #include "orbsvcs/SSLIOP/SSLIOP_X509.h"
00005
00006 #include "orbsvcs/SecurityLevel2C.h"
00007
00008 #include "tao/debug.h"
00009 #include "tao/ORB_Core.h"
00010 #include "tao/Client_Strategy_Factory.h"
00011 #include "tao/Base_Transport_Property.h"
00012 #include "tao/Transport_Cache_Manager.h"
00013 #include "tao/Thread_Lane_Resources.h"
00014 #include "tao/Stub.h"
00015 #include "tao/Transport_Connector.h"
00016 #include "tao/Blocked_Connect_Strategy.h"
00017 #include "tao/Wait_Strategy.h"
00018 #include "tao/Profile_Transport_Resolver.h"
00019 #include "ace/Auto_Ptr.h"
00020 #include "ace/os_include/os_netdb.h"
00021
00022 ACE_RCSID (SSLIOP,
00023 SSLIOP_Connector,
00024 "$Id: SSLIOP_Connector.cpp 80714 2008-02-24 19:45:27Z johnnyw $")
00025
00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00027
00028 TAO::SSLIOP::Connector::Connector (::Security::QOP qop)
00029 : TAO::IIOP_SSL_Connector (),
00030 qop_ (qop),
00031 connect_strategy_ (),
00032 base_connector_ ()
00033 {
00034 }
00035
00036 int
00037 TAO::SSLIOP::Connector::open (TAO_ORB_Core *orb_core)
00038 {
00039
00040
00041
00042
00043 ACE_NEW_RETURN (this->active_connect_strategy_,
00044 TAO_Blocked_Connect_Strategy (orb_core),
00045 -1);
00046
00047 if (this->TAO::IIOP_SSL_Connector::open (orb_core) == -1)
00048 return -1;
00049
00050
00051 CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0;
00052
00053 ACE_NEW_RETURN (connect_creation_strategy,
00054 CONNECT_CREATION_STRATEGY
00055 (orb_core->thr_mgr (),
00056 orb_core),
00057 -1);
00058
00059
00060 CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy = 0;
00061
00062 ACE_NEW_RETURN (concurrency_strategy,
00063 CONNECT_CONCURRENCY_STRATEGY (orb_core),
00064 -1);
00065
00066 ACE_Reactor *r = this->orb_core ()->reactor ();
00067
00068 return this->base_connector_.open (r,
00069 connect_creation_strategy,
00070 &this->connect_strategy_,
00071 concurrency_strategy);
00072 }
00073
00074 int
00075 TAO::SSLIOP::Connector::close (void)
00076 {
00077 (void) this->TAO::IIOP_SSL_Connector::close ();
00078
00079 delete this->base_connector_.creation_strategy ();
00080 delete this->base_connector_.concurrency_strategy ();
00081 return this->base_connector_.close ();
00082 }
00083
00084 TAO_Transport *
00085 TAO::SSLIOP::Connector::connect (TAO::Profile_Transport_Resolver *resolver,
00086 TAO_Transport_Descriptor_Interface *desc,
00087 ACE_Time_Value *timeout)
00088 {
00089 if (TAO_debug_level > 0)
00090 ACE_DEBUG ((LM_DEBUG,
00091 ACE_TEXT ("TAO_SSLIOP (%P|%t) - Connector::connect, ")
00092 ACE_TEXT ("looking for SSLIOP connection.\n")));
00093
00094 TAO_Endpoint *endpoint = desc->endpoint ();
00095
00096 if (endpoint->tag () != IOP::TAG_INTERNET_IOP)
00097 return 0;
00098
00099 TAO_SSLIOP_Endpoint *ssl_endpoint =
00100 dynamic_cast<TAO_SSLIOP_Endpoint *> (endpoint);
00101
00102 if (ssl_endpoint == 0)
00103 return 0;
00104
00105
00106
00107
00108
00109
00110
00111 CORBA::Policy_var policy =
00112 resolver->stub ()->get_policy (::Security::SecEstablishTrustPolicy);
00113
00114 SecurityLevel2::EstablishTrustPolicy_var trust_policy =
00115 SecurityLevel2::EstablishTrustPolicy::_narrow (policy.in ());
00116
00117
00118
00119
00120
00121 ::Security::EstablishTrust trust = { 0 , 0 };
00122 if (!CORBA::is_nil (trust_policy.in ()))
00123 {
00124 trust = trust_policy->trust ();
00125 }
00126
00127
00128
00129 CORBA::Boolean const establish_trust =
00130 trust.trust_in_target || trust.trust_in_client;
00131
00132
00133
00134
00135
00136
00137 if (ssl_endpoint->ssl_component ().port == 0
00138 && establish_trust)
00139 {
00140 if (TAO_debug_level > 0)
00141 {
00142 ACE_ERROR ((LM_ERROR,
00143 ACE_TEXT ("TAO_SSLIOP (%P|%t) ERROR: ")
00144 ACE_TEXT ("Cannot establish trust since ")
00145 ACE_TEXT ("no SSLIOP tagged component was ")
00146 ACE_TEXT ("found in the IOR.\n")));
00147 }
00148
00149 throw CORBA::INV_POLICY ();
00150 }
00151
00152
00153
00154 policy = resolver->stub ()->get_policy (::Security::SecQOPPolicy);
00155
00156 SecurityLevel2::QOPPolicy_var qop_policy =
00157 SecurityLevel2::QOPPolicy::_narrow (policy.in ());
00158
00159
00160
00161 ::Security::QOP qop = this->qop_;
00162
00163 if (!CORBA::is_nil (qop_policy.in ()))
00164 {
00165 qop = qop_policy->qop ();
00166 }
00167
00168
00169
00170
00171 if (qop != ::Security::SecQOPNoProtection
00172 && ssl_endpoint->ssl_component ().port == 0)
00173 {
00174 if (TAO_debug_level > 0)
00175 {
00176 ACE_ERROR ((LM_ERROR,
00177 ACE_TEXT ("TAO_SSLIOP (%P|%t) ERROR: ")
00178 ACE_TEXT ("Cannot make secure invocation since ")
00179 ACE_TEXT ("no SSLIOP tagged component was ")
00180 ACE_TEXT ("found in the IOR.\n")));
00181 }
00182
00183 throw CORBA::INV_POLICY ();
00184 }
00185
00186 if ((!establish_trust && qop == ::Security::SecQOPNoProtection)
00187 || ssl_endpoint->ssl_component ().port == 0)
00188 {
00189 return this->iiop_connect (ssl_endpoint, resolver, timeout);
00190 }
00191
00192 return this->ssliop_connect (ssl_endpoint,
00193 qop,
00194 trust,
00195 resolver,
00196 desc,
00197 timeout);
00198 }
00199
00200
00201 TAO_Profile *
00202 TAO::SSLIOP::Connector::create_profile (TAO_InputCDR& cdr)
00203 {
00204 TAO_Profile *pfile = 0;
00205 ACE_NEW_RETURN (pfile,
00206 TAO_SSLIOP_Profile (this->orb_core ()),
00207 0);
00208
00209 if (pfile->decode (cdr) == -1)
00210 {
00211 pfile->_decr_refcnt ();
00212 pfile = 0;
00213 }
00214
00215 return pfile;
00216 }
00217
00218 TAO_Profile *
00219 TAO::SSLIOP::Connector::make_profile (void)
00220 {
00221
00222
00223
00224
00225
00226 TAO_Profile *profile = 0;
00227 ACE_NEW_THROW_EX (profile,
00228 TAO_SSLIOP_Profile (this->orb_core (),
00229 0),
00230 CORBA::NO_MEMORY (
00231 CORBA::SystemException::_tao_minor_code (
00232 TAO::VMCID,
00233 ENOMEM),
00234 CORBA::COMPLETED_NO));
00235
00236 return profile;
00237 }
00238
00239
00240 TAO_Profile *
00241 TAO::SSLIOP::Connector::make_secure_profile (void)
00242 {
00243
00244
00245
00246
00247
00248 TAO_Profile *profile = 0;
00249 ACE_NEW_THROW_EX (profile,
00250 TAO_SSLIOP_Profile (this->orb_core (),
00251 1),
00252 CORBA::NO_MEMORY (
00253 CORBA::SystemException::_tao_minor_code (
00254 TAO::VMCID,
00255 ENOMEM),
00256 CORBA::COMPLETED_NO));
00257
00258 return profile;
00259 }
00260
00261
00262
00263 TAO_Profile *
00264 TAO::SSLIOP::Connector::corbaloc_scan (const char *endpoint, size_t &len)
00265 {
00266 int ssl_only = 0;
00267 if (this->check_prefix (endpoint) == 0)
00268 {
00269 ssl_only = 1;
00270 }
00271 else
00272 {
00273 if (this->TAO_IIOP_Connector::check_prefix (endpoint) != 0)
00274 return 0;
00275 }
00276
00277
00278 const char *comma_pos = ACE_OS::strchr (endpoint,',');
00279 const char *slash_pos = ACE_OS::strchr (endpoint,'/');
00280 if (comma_pos == 0 && slash_pos == 0)
00281 {
00282 if (TAO_debug_level)
00283 {
00284 ACE_DEBUG ((LM_DEBUG,
00285 ACE_TEXT("(%P|%t) SSLIOP_Connector::corbaloc_scan warning: ")
00286 ACE_TEXT("supplied string contains no comma or slash: %s\n"),
00287 endpoint));
00288 }
00289 len = ACE_OS::strlen (endpoint);
00290 }
00291 else if (slash_pos != 0 || comma_pos > slash_pos)
00292 {
00293
00294 len = slash_pos - endpoint;
00295 }
00296 else
00297 {
00298 len = comma_pos - endpoint;
00299 }
00300
00301
00302 TAO_Profile *ptmp = 0;
00303 if (ssl_only)
00304 {
00305 ptmp = this->make_secure_profile ();
00306 }
00307 else
00308 {
00309 ptmp = this->make_profile ();
00310 }
00311
00312 return ptmp;
00313 }
00314
00315
00316 int
00317 TAO::SSLIOP::Connector::check_prefix (const char *endpoint)
00318 {
00319
00320 if (!endpoint || !*endpoint) return -1;
00321
00322 const char *protocol[] = { "ssliop", "sslioploc" };
00323
00324 size_t first_slot = ACE_OS::strchr (endpoint, ':') - endpoint;
00325
00326 size_t len0 = ACE_OS::strlen (protocol[0]);
00327 size_t len1 = ACE_OS::strlen (protocol[1]);
00328
00329
00330
00331 if (first_slot == len0 && ACE_OS::strncmp (endpoint, protocol[0], len0) == 0)
00332 return 0;
00333
00334 if (first_slot == len1 && ACE_OS::strncmp (endpoint, protocol[1], len1) == 0)
00335 return 0;
00336
00337
00338
00339 return -1;
00340 }
00341
00342
00343 TAO_Transport*
00344 TAO::SSLIOP::Connector::iiop_connect (
00345 TAO_SSLIOP_Endpoint *ssl_endpoint,
00346 TAO::Profile_Transport_Resolver *resolver,
00347 ACE_Time_Value *timeout)
00348 {
00349 #if 0
00350 const ::SSLIOP::SSL &ssl_component = ssl_endpoint->ssl_component ();
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 if (ACE_BIT_DISABLED (ssl_component.target_supports,
00364 ::Security::NoProtection))
00365 throw CORBA::NO_PERMISSION (
00366 CORBA::SystemException::_tao_minor_code (
00367 TAO::VMCID,
00368 EPERM),
00369 CORBA::COMPLETED_NO);
00370 #endif
00371
00372 TAO_IIOP_Endpoint *iiop_endpoint = ssl_endpoint->iiop_endpoint ();
00373
00374
00375
00376
00377
00378 TAO_Base_Transport_Property iiop_desc (iiop_endpoint);
00379
00380
00381 return
00382 this->TAO::IIOP_SSL_Connector::connect (resolver, &iiop_desc, timeout);
00383 }
00384
00385 TAO_Transport *
00386 TAO::SSLIOP::Connector::ssliop_connect (
00387 TAO_SSLIOP_Endpoint *ssl_endpoint,
00388 ::Security::QOP qop,
00389 const ::Security::EstablishTrust &trust,
00390 TAO::Profile_Transport_Resolver *resolver,
00391 TAO_Transport_Descriptor_Interface *desc,
00392 ACE_Time_Value *max_wait_time)
00393 {
00394 const ::SSLIOP::SSL &ssl_component = ssl_endpoint->ssl_component ();
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405 if (ACE_BIT_ENABLED (ssl_component.target_requires,
00406 ::Security::NoProtection))
00407 throw CORBA::NO_PERMISSION (
00408 CORBA::SystemException::_tao_minor_code (
00409 TAO::VMCID,
00410 EPERM),
00411 CORBA::COMPLETED_NO);
00412
00413
00414
00415
00416
00417
00418
00419
00420 if (ACE_BIT_DISABLED (ssl_component.target_supports,
00421 ::Security::NoProtection)
00422 && qop == ::Security::SecQOPIntegrity)
00423 throw CORBA::INV_POLICY ();
00424
00425 const ACE_INET_Addr &remote_address = ssl_endpoint->object_addr ();
00426
00427
00428
00429
00430 if (remote_address.get_type () != AF_INET
00431 #if defined (ACE_HAS_IPV6)
00432 && remote_address.get_type () != AF_INET6
00433 #endif
00434 )
00435 {
00436 if (TAO_debug_level > 0)
00437 {
00438 ACE_DEBUG ((LM_DEBUG,
00439 ACE_TEXT ("TAO (%P|%t) SSLIOP connection failed.\n")
00440 ACE_TEXT ("TAO (%P|%t) This is most likely ")
00441 ACE_TEXT ("due to a hostname lookup ")
00442 ACE_TEXT ("failure.\n")));
00443 }
00444
00445 return 0;
00446 }
00447
00448 int result = 0;
00449 TAO::SSLIOP::Connection_Handler *svc_handler = 0;
00450 TAO_Transport *transport = 0;
00451
00452
00453
00454
00455
00456
00457
00458 if (!ssl_endpoint->credentials_set ())
00459 {
00460 if (TAO_debug_level > 2)
00461 ACE_DEBUG ((LM_DEBUG,
00462 ACE_TEXT ("TAO (%P|%t) Initializing SSLIOP_Endpoint \n")
00463 ));
00464
00465 if (this->base_connector_.creation_strategy ()->make_svc_handler (
00466 svc_handler) != 0)
00467 {
00468 if (TAO_debug_level > 0)
00469 ACE_DEBUG ((LM_ERROR,
00470 ACE_TEXT ("TAO (%P|%t) Unable to create SSLIOP ")
00471 ACE_TEXT ("service handler.\n")));
00472
00473 return 0;
00474 }
00475
00476 ACE_Event_Handler_var
00477 safe_handler (svc_handler);
00478 TAO::SSLIOP::OwnCredentials_var credentials =
00479 this->retrieve_credentials (resolver->stub (),
00480 svc_handler->peer ().ssl ());
00481
00482 safe_handler.release ();
00483
00484 ssl_endpoint->set_sec_attrs (qop, trust, credentials.in());
00485 }
00486
00487
00488 if (this->orb_core ()->lane_resources ().transport_cache ().find_transport (
00489 desc,
00490 transport) == 0)
00491 {
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503 if (svc_handler)
00504 svc_handler->remove_reference();
00505
00506 ACE_Event_Handler_var
00507 safe_handler (svc_handler);
00508
00509 if (TAO_debug_level > 2)
00510 ACE_DEBUG ((LM_DEBUG,
00511 ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, ")
00512 ACE_TEXT ("got existing transport[%d]\n"),
00513 transport->id ()));
00514
00515
00516 if (!transport->is_connected())
00517 {
00518 if (!this->wait_for_connection_completion (resolver,
00519 transport,
00520 max_wait_time))
00521 {
00522 ACE_ERROR ((LM_ERROR,
00523 ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect,")
00524 ACE_TEXT ("wait for completion failed\n")));
00525
00526 }
00527 }
00528 }
00529 else
00530 {
00531 if (TAO_debug_level > 4)
00532 ACE_DEBUG ((LM_DEBUG,
00533 ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, ")
00534 ACE_TEXT ("making a new connection \n")));
00535
00536
00537 this->orb_core ()->lane_resources ().transport_cache ().purge ();
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556 if (svc_handler == 0 &&
00557 this->base_connector_.creation_strategy ()->make_svc_handler (
00558 svc_handler) != 0)
00559 {
00560 if (TAO_debug_level > 0)
00561 ACE_DEBUG ((LM_ERROR,
00562 ACE_TEXT ("TAO (%P|%t) Unable to create SSLIOP ")
00563 ACE_TEXT ("service handler.\n")));
00564
00565 return 0;
00566 }
00567
00568 ACE_Event_Handler_var
00569 safe_handler (svc_handler);
00570
00571
00572
00573 int verify_mode = 0;
00574
00575
00576
00577
00578
00579
00580 if (trust.trust_in_client)
00581 verify_mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
00582
00583
00584 else if (trust.trust_in_target)
00585 verify_mode = SSL_VERIFY_PEER;
00586
00587
00588
00589 else
00590 verify_mode = ACE_SSL_Context::instance ()->default_verify_mode ();
00591
00592 ::SSL_set_verify (svc_handler->peer ().ssl (), verify_mode, 0);
00593
00594
00595
00596
00597
00598
00599
00600 if ((qop == ::Security::SecQOPNoProtection
00601 || qop == ::Security::SecQOPIntegrity)
00602 && ::SSL_set_cipher_list (svc_handler->peer ().ssl (),
00603 "eNULL") == 0)
00604 {
00605 if (TAO_debug_level > 0)
00606 ACE_DEBUG ((LM_ERROR,
00607 ACE_TEXT ("(%P|%t) Unable to set eNULL ")
00608 ACE_TEXT ("SSL cipher.\n")));
00609
00610 throw CORBA::INV_POLICY ();
00611 }
00612
00613
00614 (void)safe_handler.release ();
00615
00616
00617 ACE_Synch_Options synch_options;
00618
00619 this->active_connect_strategy_->synch_options (max_wait_time,
00620 synch_options);
00621
00622
00623
00624
00625
00626
00627
00628
00629 result = this->base_connector_.connect (svc_handler,
00630 remote_address,
00631 synch_options);
00632
00633
00634
00635
00636
00637 svc_handler->remove_reference ();
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 ACE_Event_Handler_var svc_handler_auto_ptr (svc_handler);
00649
00650 transport =
00651 svc_handler->transport ();
00652
00653 if (result == -1)
00654 {
00655
00656 if (errno == EWOULDBLOCK)
00657 {
00658
00659
00660
00661 if (!this->wait_for_connection_completion (resolver,
00662 transport,
00663 max_wait_time))
00664 {
00665 if (TAO_debug_level > 2)
00666 ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - SSLIOP_Connector::"
00667 "ssliop_connect, "
00668 "wait for completion failed\n"));
00669 }
00670 }
00671 else
00672 {
00673
00674 transport = 0;
00675 }
00676 }
00677
00678
00679 if (transport == 0)
00680 {
00681
00682 if (TAO_debug_level)
00683 {
00684 char buffer [MAXHOSTNAMELEN + 6 + 1];
00685 ssl_endpoint->addr_to_string (buffer,
00686 sizeof (buffer) - 1);
00687 ACE_DEBUG ((LM_ERROR,
00688 ACE_TEXT ("TAO (%P|%t) - SSL connection to ")
00689 ACE_TEXT ("<%s:%d> failed (%p)\n"),
00690 buffer,
00691 remote_address.get_port_number (),
00692 ACE_TEXT ("errno")));
00693 }
00694
00695 return 0;
00696 }
00697
00698
00699 if (svc_handler->keep_waiting ())
00700 {
00701 svc_handler->connection_pending ();
00702 }
00703
00704
00705 if (svc_handler->error_detected ())
00706 {
00707 svc_handler->cancel_pending_connection ();
00708 }
00709
00710
00711
00712 if (TAO_debug_level > 2)
00713 ACE_DEBUG ((LM_DEBUG,
00714 "TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, "
00715 "new SSL connection to port %d on transport[%d]\n",
00716 remote_address.get_port_number (),
00717 svc_handler->peer ().get_handle ()));
00718
00719
00720 int retval =
00721 this->orb_core ()->
00722 lane_resources ().transport_cache ().cache_transport (desc,
00723 transport);
00724
00725
00726 if (retval != 0)
00727 {
00728
00729 svc_handler->close ();
00730
00731 if (TAO_debug_level > 0)
00732 {
00733 ACE_ERROR ((LM_ERROR,
00734 "TAO (%P|%t) - SLIIOP_Connector::ssliop_connect, "
00735 "could not add the new connection to cache\n"));
00736 }
00737
00738 return 0;
00739 }
00740
00741
00742 if (svc_handler->error_detected ())
00743 {
00744 svc_handler->cancel_pending_connection ();
00745 transport->purge_entry();
00746 return 0;
00747 }
00748
00749 if (transport->is_connected () &&
00750 transport->wait_strategy ()->register_handler () != 0)
00751 {
00752
00753
00754
00755
00756 (void) transport->purge_entry ();
00757
00758
00759 (void) transport->close_connection ();
00760
00761 if (TAO_debug_level > 0)
00762 ACE_ERROR ((LM_ERROR,
00763 "TAO (%P|%t) - SSLIOP_Connector [%d]::ssliop_connect, "
00764 "could not register the transport "
00765 "in the reactor.\n",
00766 transport->id ()));
00767
00768 return 0;
00769 }
00770 }
00771
00772 return transport;
00773 }
00774
00775 TAO::SSLIOP::OwnCredentials *
00776 TAO::SSLIOP::Connector::retrieve_credentials (TAO_Stub *stub,
00777 SSL *ssl)
00778 {
00779
00780 CORBA::Policy_var policy =
00781 stub->get_policy (::SecurityLevel3::ContextEstablishmentPolicyType);
00782
00783 SecurityLevel3::ContextEstablishmentPolicy_var creds_policy =
00784 SecurityLevel3::ContextEstablishmentPolicy::_narrow (
00785 policy.in ());
00786
00787 TAO::SSLIOP::OwnCredentials_var ssliop_credentials;
00788
00789
00790
00791 if (!CORBA::is_nil (creds_policy.in ()))
00792 {
00793 SecurityLevel3::OwnCredentialsList_var creds_list =
00794 creds_policy->creds_list ();
00795
00796 if (creds_list->length () > 0)
00797 {
00798
00799 SecurityLevel3::Credentials_ptr credentials =
00800 creds_list[0u];
00801
00802 ssliop_credentials =
00803 TAO::SSLIOP::OwnCredentials::_narrow (credentials);
00804
00805 if (!CORBA::is_nil (ssliop_credentials.in ()))
00806 {
00807 TAO::SSLIOP::X509_var x509 = ssliop_credentials->x509 ();
00808 if (::SSL_use_certificate (ssl, x509.in ()) != 1)
00809 return TAO::SSLIOP::OwnCredentials::_nil ();
00810
00811 TAO::SSLIOP::EVP_PKEY_var evp = ssliop_credentials->evp ();
00812 if (evp.in () != 0
00813 && ::SSL_use_PrivateKey (ssl, evp.in ()) != 1)
00814 {
00815
00816 (void) ::SSL_use_certificate (ssl, 0);
00817 return TAO::SSLIOP::OwnCredentials::_nil ();
00818 }
00819 }
00820 }
00821 }
00822 else
00823 {
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833 TAO::SSLIOP::OwnCredentials_ptr & c = ssliop_credentials.out ();
00834 ACE_NEW_THROW_EX (c,
00835 TAO::SSLIOP::OwnCredentials (
00836 ::SSL_get_certificate (ssl),
00837 ::SSL_get_privatekey (ssl)),
00838 CORBA::NO_MEMORY ());
00839 }
00840
00841 return ssliop_credentials._retn ();
00842 }
00843
00844 int
00845 TAO::SSLIOP::Connector::cancel_svc_handler (
00846 TAO_Connection_Handler * svc_handler)
00847 {
00848 TAO::SSLIOP::Connection_Handler* handler=
00849 dynamic_cast<TAO::SSLIOP::Connection_Handler*> (svc_handler);
00850
00851 if (handler)
00852
00853 return this->base_connector_.cancel (handler);
00854
00855 return -1;
00856 }
00857
00858 TAO_END_VERSIONED_NAMESPACE_DECL