2 * Copyright (c) 2008, 2009 Nicira Networks.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #define STREAM_SSL_H 1
22 bool stream_ssl_is_configured(void);
23 void stream_ssl_set_private_key_file(const char *file_name);
24 void stream_ssl_set_certificate_file(const char *file_name);
25 void stream_ssl_set_ca_cert_file(const char *file_name, bool bootstrap);
26 void stream_ssl_set_peer_ca_cert_file(const char *file_name);
28 #define STREAM_SSL_LONG_OPTIONS \
29 {"private-key", required_argument, 0, 'p'}, \
30 {"certificate", required_argument, 0, 'c'}, \
31 {"ca-cert", required_argument, 0, 'C'},
33 #define STREAM_SSL_OPTION_HANDLERS \
35 stream_ssl_set_private_key_file(optarg); \
39 stream_ssl_set_certificate_file(optarg); \
43 stream_ssl_set_ca_cert_file(optarg, false); \
45 #else /* !HAVE_OPENSSL */
46 static inline bool stream_ssl_is_configured(void)
50 #define STREAM_SSL_LONG_OPTIONS
51 #define STREAM_SSL_OPTION_HANDLERS
52 #endif /* !HAVE_OPENSSL */
54 #endif /* stream-ssl.h */