#define CAFILE "ca.pem"
#define MSG "GET / HTTP/1.0\r\n\r\n"
-int server_authorized_p = 0;
-
extern int tcp_connect (void);
extern void tcp_close (int sd);
+int server_authorized_p = 0;
+
int
authz_recv_callback (gnutls_session_t session,
const int *authz_formats,
gnutls_session_t session;
char buffer[MAX_BUF + 1];
gnutls_certificate_credentials_t xcred;
- /* Allow connections to servers that have OpenPGP keys as well.
- */
- const int cert_type_priority[3] = { GNUTLS_CRT_X509,
- GNUTLS_CRT_OPENPGP, 0
- };
const int authz_client_formats[] = {
GNUTLS_AUTHZ_SAML_ASSERTION,
};
*/
gnutls_certificate_set_x509_trust_file (xcred, CAFILE, GNUTLS_X509_FMT_PEM);
- /* Initialize TLS session
+ /* Initialize TLS session
*/
gnutls_init (&session, GNUTLS_CLIENT);
/* Use default priorities */
gnutls_set_default_priority (session);
- gnutls_certificate_type_set_priority (session, cert_type_priority);
/* put the x509 credentials to the current session
*/
#define SA struct sockaddr
#define MSG "GET / HTTP/1.0\r\n\r\n"
-const int kx_priority[] = { GNUTLS_KX_SRP, GNUTLS_KX_SRP_DSS,
- GNUTLS_KX_SRP_RSA, 0
-};
-
int
main (void)
{
/* Set the priorities.
*/
gnutls_set_default_priority (session);
- gnutls_kx_set_priority (session, kx_priority);
/* put the SRP credentials to the current session
gnutls_session_t session;
char buffer[MAX_BUF + 1];
gnutls_certificate_credentials_t xcred;
- /* Allow connections to servers that have OpenPGP keys as well.
- */
- const int cert_type_priority[3] = { GNUTLS_CRT_X509,
- GNUTLS_CRT_OPENPGP, 0
- };
gnutls_global_init ();
/* Use default priorities */
gnutls_set_default_priority (session);
- gnutls_certificate_type_set_priority (session, cert_type_priority);
/* put the x509 credentials to the current session
*/
/* These are global */
gnutls_certificate_credentials_t cred;
-const int cert_type_priority[2] = { GNUTLS_CRT_OPENPGP, 0 };
gnutls_dh_params_t dh_params;
static int
for (;;)
{
session = initialize_tls_session ();
- gnutls_certificate_type_set_priority (session, cert_type_priority);
sd = accept (listen_sd, (SA *) & sa_cli, &client_len);