| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| Installing OpenSSL - |
| On Mac: |
| brew install openssl |
| On Linux : |
| |
| Set up the certificate for testing. The files generated by this set of steps are used by the boost example programs. |
| These are also the steps used to generate the test certificates used by the Drillbit unit tests. |
| |
| Generate a private key |
| |
| openssl genrsa -des3 -out drillTestServerKey.pem 1024 |
| |
| Generate Certificate signing request |
| |
| openssl req -new -key drillTestServerKey.pem -out drillTestServer.csr |
| |
| Sign certificate with private key |
| |
| openssl x509 -req -days 3650 -in drillTestServer.csr -signkey drillTestServerKey.pem -out drillTestCert.pem |
| |
| Remove password requirement (needed for example) |
| |
| cp drillTestServerKey.pem drillTestServerKey.safe.pem |
| openssl rsa -in drillTestServerKey.safe.pem -out drillTestServerKey.pem |
| |
| Generate dhparam file |
| |
| openssl dhparam -out dh512.pem 512 |
| |
| [For use in JAVA environments] Export to pkcs12 format |
| |
| openssl pkcs12 -export -out drillTestCert.p12 -inkey drillTestServerKey.pem -in drillTestCert.pem |
| |
| This will provide : |
| drillTestServerKey.pem - Server private key |
| drillTestCert.pem - Client, Certificate Chain File |
| dh512.pem - Diffie-Hellman parameters |
| |
| Running CMake |
| On MacOs |
| Run cmake from the build directory using: |
| cmake -G Xcode -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" -DCMAKE_BUILD_TYPE=Debug .. |