-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: samples: net: sockets: http_server: Add HTTPS support
The example certs are copied from echo-server sample application. This is not yet working, so is WIP. Signed-off-by: Jukka Rissanen <[email protected]>
- Loading branch information
Showing
12 changed files
with
240 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#include <zephyr/linker/iterable_sections.h> | ||
|
||
ITERABLE_SECTION_ROM(http_resource_desc_test_http_service, 4) | ||
ITERABLE_SECTION_ROM(http_resource_desc_test_https_service, 4) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef __CERTIFICATE_H__ | ||
#define __CERTIFICATE_H__ | ||
|
||
enum tls_tag { | ||
/** The Certificate Authority public key */ | ||
HTTP_SERVER_CA_CERTIFICATE_TAG, | ||
/** Used for both the public and private server keys */ | ||
HTTP_SERVER_CERTIFICATE_TAG, | ||
/** Used for both the public and private client keys */ | ||
HTTP_SERVER_CLIENT_CERTIFICATE_TAG, | ||
PSK_TAG, | ||
}; | ||
|
||
#if !defined(CONFIG_NET_SAMPLE_CERTS_WITH_SC) | ||
static const unsigned char server_certificate[] = { | ||
#include "https-server-cert.der.inc" | ||
}; | ||
|
||
/* This is the private key in pkcs#8 format. */ | ||
static const unsigned char private_key[] = { | ||
#include "https-server-key.der.inc" | ||
}; | ||
|
||
#else | ||
|
||
static const unsigned char ca_certificate[] = { | ||
#include "ca.der.inc" | ||
}; | ||
|
||
static const unsigned char server_certificate[] = { | ||
#include "server.der.inc" | ||
}; | ||
|
||
/* This is the private key in pkcs#8 format. */ | ||
static const unsigned char private_key[] = { | ||
#include "server_privkey.der.inc" | ||
}; | ||
#endif | ||
|
||
#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) | ||
#include CONFIG_NET_SAMPLE_PSK_HEADER_FILE | ||
#endif | ||
|
||
#endif /* __CERTIFICATE_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef __DUMMY_PSK_H__ | ||
#define __DUMMY_PSK_H__ | ||
|
||
static const unsigned char psk[] = {0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, | ||
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; | ||
static const char psk_id[] = "PSK_identity"; | ||
|
||
#endif /* __DUMMY_PSK_H__ */ |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.