mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-09 03:22:45 +03:00
Add SSL parameters to the example
This commit is contained in:
@@ -359,10 +359,6 @@ field_get_checksum(const char *key,
|
|||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
struct tfiles_checksums *context = (struct tfiles_checksums *)user_data;
|
struct tfiles_checksums *context = (struct tfiles_checksums *)user_data;
|
||||||
|
|
||||||
char path[1026];
|
|
||||||
FILE *f;
|
|
||||||
|
|
||||||
(void)key;
|
(void)key;
|
||||||
|
|
||||||
context->file[context->index - 1].length += valuelen;
|
context->file[context->index - 1].length += valuelen;
|
||||||
@@ -638,6 +634,17 @@ InformWebsockets(struct mg_context *ctx)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NO_SSL
|
||||||
|
int
|
||||||
|
init_ssl(void *ssl_context, void *user_data)
|
||||||
|
{
|
||||||
|
/* Add application specific SSL initialization */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -656,6 +663,10 @@ main(int argc, char *argv[])
|
|||||||
#ifndef NO_SSL
|
#ifndef NO_SSL
|
||||||
"ssl_certificate",
|
"ssl_certificate",
|
||||||
"../../resources/cert/server.pem",
|
"../../resources/cert/server.pem",
|
||||||
|
"ssl_protocol_version",
|
||||||
|
"3",
|
||||||
|
"ssl_cipher_list",
|
||||||
|
"DES-CBC3-SHA:AES128-SHA:AES128-GCM-SHA256"
|
||||||
#endif
|
#endif
|
||||||
0};
|
0};
|
||||||
struct mg_callbacks callbacks;
|
struct mg_callbacks callbacks;
|
||||||
@@ -696,6 +707,9 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Start CivetWeb web server */
|
/* Start CivetWeb web server */
|
||||||
memset(&callbacks, 0, sizeof(callbacks));
|
memset(&callbacks, 0, sizeof(callbacks));
|
||||||
|
#ifndef NO_SSL
|
||||||
|
callbacks.init_ssl = init_ssl;
|
||||||
|
#endif
|
||||||
ctx = mg_start(&callbacks, 0, options);
|
ctx = mg_start(&callbacks, 0, options);
|
||||||
|
|
||||||
/* Add handler EXAMPLE_URI, to explain the example */
|
/* Add handler EXAMPLE_URI, to explain the example */
|
||||||
@@ -813,3 +827,4 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user