defensive-coding-guide/pot/Features/snippets/TLS-Client-GNUTLS-Credentials.pot

46 lines
1.3 KiB
Text

#
# AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
"POT-Creation-Date: 2013-08-13T01:54:52\n"
"PO-Revision-Date: 2013-08-13T01:54:52\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: programlisting
#, no-c-format
msgid "\n"
"// Load the trusted CA certificates.\n"
"gnutls_certificate_credentials_t cred = NULL;\n"
"int ret = gnutls_certificate_allocate_credentials (&amp;cred);\n"
"if (ret != GNUTLS_E_SUCCESS) {\n"
" fprintf(stderr, \"error: gnutls_certificate_allocate_credentials: %s\n"
"\",\n"
" gnutls_strerror(ret));\n"
" exit(1);\n"
"}\n"
"// gnutls_certificate_set_x509_system_trust needs GNUTLS version 3.0\n"
"// or newer, so we hard-code the path to the certificate store\n"
"// instead.\n"
"static const char ca_bundle[] = \"/etc/ssl/certs/ca-bundle.crt\";\n"
"ret = gnutls_certificate_set_x509_trust_file\n"
" (cred, ca_bundle, GNUTLS_X509_FMT_PEM);\n"
"if (ret == 0) {\n"
" fprintf(stderr, \"error: no certificates found in: %s\n"
"\", ca_bundle);\n"
" exit(1);\n"
"}\n"
"if (ret &lt; 0) {\n"
" fprintf(stderr, \"error: gnutls_certificate_set_x509_trust_files(%s): %s\n"
"\",\n"
" ca_bundle, gnutls_strerror(ret));\n"
" exit(1);\n"
"}\n"
""
msgstr ""