-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] add C and C++ SSL quickstarts #10771
[docs] add C and C++ SSL quickstarts #10771
Conversation
✔️ Deploy Preview for infallible-bardeen-164bc9 ready! 🔨 Explore the source changes: c6f43a0 🔍 Inspect the deploy log: https://app.netlify.com/sites/infallible-bardeen-164bc9/deploys/61a97f9acdc1bd0007a180e6 😎 Browse the preview: https://deploy-preview-10771--infallible-bardeen-164bc9.netlify.app/latest/quick-start/build-apps/c/ysql/#use-c-with-ssl |
✔️ Deploy Preview for infallible-bardeen-164bc9 ready! 🔨 Explore the source changes: e5a31bd 🔍 Inspect the deploy log: https://app.netlify.com/sites/infallible-bardeen-164bc9/deploys/61aad0ca96266400071fbe06 😎 Browse the preview: https://deploy-preview-10771--infallible-bardeen-164bc9.netlify.app/latest/quick-start/build-apps/c/ysql/#use-c-with-ssl |
1. You can compile the file using `gcc` or `clang`. To compile the application with `clang`, run the following command: | ||
|
||
```sh | ||
$ clang yb_hello_world_ssl.c \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ clang ybsql_hello_world_ssl.c
```sh | ||
$ clang yb_hello_world_ssl.c \ | ||
-lpq \ | ||
-I path/to/yugabytedb/postgres/include -L path/to/yugabytedb/postgres/postgres/lib \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path/to/yugabytedb/postgres/lib
1. Run with: | ||
|
||
```sh | ||
$ ./ybsql_hello_world |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ./ybsql_hello_world_ssl
|
||
The default SSL mode for libpq is `prefer`. In the `require` SSL mode, the root CA certificate is not required to be configured. | ||
|
||
To enable `verify-ca` and `verify-full`, you configure the path to the CA in the connection string using the `sslrootcert` parameter. The default path is `~/.postgresql/root.crt`. If the root certificate is in a different file, specify it in the sslrootcert parameter. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got error "Connection to database failed: root certificate file "/Users/myuser/.yugabytedb/root.crt" does not exist" which implies .postgresql is not the default directory
Starting with C, and will add C++ once we get C working. 😁
@netlify /latest/quick-start/build-apps/c/ysql/#use-c-with-ssl