00001 /** @file 00002 00003 A brief file description 00004 00005 @section license License 00006 00007 Licensed to the Apache Software Foundation (ASF) under one 00008 or more contributor license agreements. See the NOTICE file 00009 distributed with this work for additional information 00010 regarding copyright ownership. The ASF licenses this file 00011 to you under the Apache License, Version 2.0 (the 00012 "License"); you may not use this file except in compliance 00013 with the License. You may obtain a copy of the License at 00014 00015 http://www.apache.org/licenses/LICENSE-2.0 00016 00017 Unless required by applicable law or agreed to in writing, software 00018 distributed under the License is distributed on an "AS IS" BASIS, 00019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 See the License for the specific language governing permissions and 00021 limitations under the License. 00022 */ 00023 00024 #ifndef __P_SSLCERTLOOKUP_H__ 00025 #define __P_SSLCERTLOOKUP_H__ 00026 00027 #include "ProxyConfig.h" 00028 #include "P_SSLUtils.h" 00029 00030 struct SSLConfigParams; 00031 struct SSLContextStorage; 00032 00033 struct SSLCertLookup : public ConfigInfo 00034 { 00035 SSLContextStorage * ssl_storage; 00036 SSL_CTX * ssl_default; 00037 00038 bool insert(SSL_CTX * ctx, const char * name); 00039 bool insert(SSL_CTX * ctx, const IpEndpoint& address); 00040 SSL_CTX * findInfoInHash(const char * address) const; 00041 SSL_CTX * findInfoInHash(const IpEndpoint& address) const; 00042 00043 // Return the last-resort default TLS context if there is no name or address match. 00044 SSL_CTX * defaultContext() const { return ssl_default; } 00045 00046 unsigned count() const; 00047 SSL_CTX * get(unsigned i) const; 00048 00049 SSLCertLookup(); 00050 virtual ~SSLCertLookup(); 00051 }; 00052 00053 #endif /* __P_SSLCERTLOOKUP_H__ */