MCPcopy Create free account
hub / github.com/apache/qpid-proton / main

Function main

cpp/examples/ssl.cpp:157–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155};
156
157int main(int argc, char **argv) {
158 example::options opts(argc, argv);
159 opts.add_value(cert_directory, 'c', "cert_directory",
160 "directory containing SSL certificates and private key information", "CERTDIR");
161 opts.add_value(verify, 'v', "verify", "verify type: \"minimum\", \"full\", \"fail\"", "VERIFY");
162
163 try {
164 opts.parse();
165
166 size_t sz = cert_directory.size();
167 if (sz) {
168 if (cert_directory[sz -1] != '/') {
169 cert_directory.append("/");
170 }
171 } else {
172 cert_directory = "ssl-certs/";
173 }
174
175 if (verify != verify_noname && verify != verify_full && verify != verify_fail) {
176 throw std::runtime_error("bad verify argument: " + verify);
177 }
178
179 hello_world_direct hwd;
180 proton::container(hwd).run();
181 return 0;
182 } catch (const example::bad_option& e) {
183 std::cout << opts << std::endl << e.what() << std::endl;
184 } catch (const std::exception& e) {
185 std::cerr << e.what() << std::endl;
186 }
187 return 1;
188}
189
190
191bool using_OpenSSL() {

Callers

nothing calls this directly

Calls 7

add_valueMethod · 0.80
containerClass · 0.50
parseMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
runMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected