zephyr/samples/net/sockets/http_server/src/certificate.h
Matt Rodgers 45c6553567 samples: http_server: consolidate certificate options
Remove the CONFIG_NET_SAMPLE_CERTS_WITH_SC option and make the CA-signed
certificate the only option - there is no real downside to this over
using the unsigned certificate.

Remove adding of CA certificate as a TLS credential on the server, since
this credential is not used by the server. It may be useful to include
in any client code used to communicate with the server, so the
certificate itself is retained.

After this, some TLS tag enumerations are unused so have been removed.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-12-10 10:43:38 -05:00

31 lines
650 B
C

/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __CERTIFICATE_H__
#define __CERTIFICATE_H__
enum tls_tag {
/** Used for both the public and private server keys */
HTTP_SERVER_CERTIFICATE_TAG,
/* Used for pre-shared key */
PSK_TAG,
};
static const unsigned char server_certificate[] = {
#include "server_cert.der.inc"
};
/* This is the private key in pkcs#8 format. */
static const unsigned char private_key[] = {
#include "server_privkey.der.inc"
};
#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
#include CONFIG_NET_SAMPLE_PSK_HEADER_FILE
#endif
#endif /* __CERTIFICATE_H__ */