mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 17:52:54 +03:00
examples/coap-server.c: Re-order code (move fill_keystore) to support PKI
fill_keystore() now needs to be before coap_new_endpoint() is called.
This commit is contained in:
1 parent
82c9ccc75b
commit
b2205d2e40
1 file changed
+2
-1
@@ -349,6 +349,8 @@ get_context(const char *node, const char *port) {
|
||||
if (!ctx) {
|
||||
return NULL;
|
||||
}
|
||||
/* Need PSK set up before we set up (D)TLS endpoints */
|
||||
fill_keystore(ctx);
|
||||
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
|
||||
@@ -526,7 +528,6 @@ main(int argc, char **argv) {
|
||||
if (!ctx)
|
||||
return -1;
|
||||
|
||||
fill_keystore(ctx);
|
||||
init_resources(ctx);
|
||||
|
||||
/* join multicast group if requested at command line */
|
||||
|
||||
Reference in new issue
Block a user