Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
80fe93bc
Commit
80fe93bc
authored
19 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
OK, I must've been halucinating or something because I no longer see the
bug I thought I saw before when I changed this...!
parent
ea03ad3b
No related branches found
Branches containing commit
Tags
curl-7_12_0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/gtls.c
+23
-21
23 additions, 21 deletions
lib/gtls.c
with
23 additions
and
21 deletions
lib/gtls.c
+
23
−
21
View file @
80fe93bc
...
...
@@ -57,10 +57,25 @@
/* The last #include file should be: */
#include
"memdebug.h"
/* Enable GnuTLS debugging by defining GTLSDEBUG */
/*#define GTLSDEBUG */
#ifdef GTLSDEBUG
static
void
tls_log_func
(
int
level
,
const
char
*
str
)
{
fprintf
(
stderr
,
"|<%d>| %s"
,
level
,
str
);
}
#endif
/* Global GnuTLS init, called from Curl_ssl_init() */
int
Curl_gtls_init
(
void
)
{
gnutls_global_init
();
#ifdef GTLSDEBUG
gnutls_global_set_log_function
(
tls_log_func
);
gnutls_global_set_log_level
(
2
);
#endif
return
1
;
}
...
...
@@ -95,7 +110,6 @@ static void showtime(struct SessionHandle *data,
infof
(
data
,
"%s"
,
data
->
state
.
buffer
);
}
/*
* This function is called after the TCP connect has completed. Setup the TLS
* layer and do all necessary magic.
...
...
@@ -105,7 +119,7 @@ Curl_gtls_connect(struct connectdata *conn,
int
sockindex
)
{
const
int
cert_type_priority
[
3
]
=
{
GNUTLS_CRT_X509
,
0
};
const
int
cert_type_priority
[]
=
{
GNUTLS_CRT_X509
,
0
};
struct
SessionHandle
*
data
=
conn
->
data
;
gnutls_session
session
;
int
rc
;
...
...
@@ -135,25 +149,13 @@ Curl_gtls_connect(struct connectdata *conn,
return
CURLE_SSL_CONNECT_ERROR
;
}
if
(
data
->
set
.
ssl
.
CAfile
)
{
/* set the trusted CA cert bundle file */
/*
* Unfortunately, if a file name is set here and this function fails for
* whatever reason (missing file, bad file, etc), gnutls will no longer
* handshake properly but it just loops forever. Therefore, we must return
* error here if we get an error when setting the CA cert file name.
*
* (Question/report posted to the help-gnutls mailing list, April 8 2005)
*/
rc
=
gnutls_certificate_set_x509_trust_file
(
conn
->
ssl
[
sockindex
].
cred
,
data
->
set
.
ssl
.
CAfile
,
GNUTLS_X509_FMT_PEM
);
if
(
rc
)
{
failf
(
data
,
"error reading the ca cert file %s"
,
data
->
set
.
ssl
.
CAfile
);
return
CURLE_SSL_CACERT
;
}
/* set the trusted CA cert bundle file */
rc
=
gnutls_certificate_set_x509_trust_file
(
conn
->
ssl
[
sockindex
].
cred
,
data
->
set
.
ssl
.
CAfile
,
GNUTLS_X509_FMT_PEM
);
if
(
rc
)
{
infof
(
data
,
"error reading the ca cert file %s"
,
data
->
set
.
ssl
.
CAfile
);
}
/* Initialize TLS session as a client */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment