00001 // -*- C++ -*- 00002 // 00003 // $Id: SSL_Context.inl 83916 2008-11-28 16:32:21Z johnnyw $ 00004 00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 ACE_SSL_Data_File::ACE_SSL_Data_File (void) 00009 : type_ (-1) 00010 { 00011 } 00012 00013 ACE_INLINE 00014 ACE_SSL_Data_File::ACE_SSL_Data_File (const char *file_name, 00015 int type) 00016 : file_name_ (file_name), 00017 type_ (type) 00018 { 00019 } 00020 00021 ACE_INLINE const char * 00022 ACE_SSL_Data_File::file_name (void) const 00023 { 00024 return this->file_name_.c_str (); 00025 } 00026 00027 ACE_INLINE int 00028 ACE_SSL_Data_File::type (void) const 00029 { 00030 return this->type_; 00031 } 00032 00033 // **************************************************************** 00034 00035 ACE_INLINE void 00036 ACE_SSL_Context::check_context (void) 00037 { 00038 if (this->context_ == 0) 00039 { 00040 this->set_mode (); 00041 } 00042 00043 ::SSL_CTX_set_verify (this->context_, this->default_verify_mode (), 00044 this->default_verify_callback ()); 00045 } 00046 00047 ACE_INLINE SSL_CTX * 00048 ACE_SSL_Context::context (void) 00049 { 00050 this->check_context (); 00051 return this->context_; 00052 } 00053 00054 ACE_INLINE int 00055 ACE_SSL_Context::private_key_type (void) const 00056 { 00057 return this->private_key_.type (); 00058 } 00059 00060 ACE_INLINE const char* 00061 ACE_SSL_Context::private_key_file_name (void) const 00062 { 00063 return this->private_key_.file_name (); 00064 } 00065 00066 ACE_INLINE int 00067 ACE_SSL_Context::certificate_type (void) const 00068 { 00069 return this->certificate_.type (); 00070 } 00071 00072 ACE_INLINE const char* 00073 ACE_SSL_Context::certificate_file_name (void) const 00074 { 00075 return this->certificate_.file_name (); 00076 } 00077 00078 ACE_INLINE int 00079 ACE_SSL_Context::dh_params_file_type (void) const 00080 { 00081 return this->dh_params_.type (); 00082 } 00083 00084 ACE_INLINE const char* 00085 ACE_SSL_Context::dh_params_file_name (void) const 00086 { 00087 return this->dh_params_.file_name (); 00088 } 00089 00090 ACE_INLINE void 00091 ACE_SSL_Context::default_verify_mode (int mode) 00092 { 00093 this->default_verify_mode_ = mode; 00094 } 00095 00096 ACE_INLINE int 00097 ACE_SSL_Context::default_verify_mode (void) const 00098 { 00099 return this->default_verify_mode_; 00100 } 00101 00102 ACE_INLINE void 00103 ACE_SSL_Context::default_verify_callback (int (*callback) (int, X509_STORE_CTX*)) 00104 { 00105 this->default_verify_callback_ = callback; 00106 } 00107 00108 ACE_INLINE int (*ACE_SSL_Context::default_verify_callback(void) const)(int,X509_STORE_CTX *) 00109 { 00110 return this->default_verify_callback_; 00111 } 00112 00113 ACE_INLINE int 00114 ACE_SSL_Context::get_mode (void) const 00115 { 00116 return this->mode_; 00117 } 00118 00119 ACE_INLINE int 00120 ACE_SSL_Context::have_trusted_ca (void) const 00121 { 00122 return this->have_ca_; 00123 } 00124 00125 ACE_END_VERSIONED_NAMESPACE_DECL