Subversion Repositories Tewi

Rev

Rev 16 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16 Rev 19
Line 1... Line 1...
1
/* $Id: ssl.c 16 2024-09-13 15:09:52Z nishi $ */
1
/* $Id: ssl.c 19 2024-09-14 00:51:41Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_ssl.h"
5
#include "tw_ssl.h"
6
 
6
 
Line 23... Line 23...
23
	struct tw_config_entry* e = tw_vhost_match(s, (uint64_t)arg);
23
	struct tw_config_entry* e = tw_vhost_match(s, (uint64_t)arg);
24
	if(e != NULL && e->sslkey != NULL && e->sslcert != NULL) {
24
	if(e != NULL && e->sslkey != NULL && e->sslcert != NULL) {
25
		SSL_use_PrivateKey_file(ssl, e->sslkey, SSL_FILETYPE_PEM);
25
		SSL_use_PrivateKey_file(ssl, e->sslkey, SSL_FILETYPE_PEM);
26
		SSL_use_certificate_file(ssl, e->sslcert, SSL_FILETYPE_PEM);
26
		SSL_use_certificate_file(ssl, e->sslcert, SSL_FILETYPE_PEM);
27
		return 1;
27
		return 1;
-
 
28
	} else if(config.root.sslkey != NULL && config.root.sslcert != NULL) {
-
 
29
		SSL_use_PrivateKey_file(ssl, config.root.sslkey, SSL_FILETYPE_PEM);
-
 
30
		SSL_use_certificate_file(ssl, config.root.sslcert, SSL_FILETYPE_PEM);
28
	} else {
31
	} else {
29
		return 0;
32
		return 0;
30
	}
33
	}
31
}
34
}
32
 
35