Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Bootstrapping over DTLS (coaps)

Hi,

   Currently there is no UI in the bootstrap server demo to set secure bootstrap configuration. But you can use the REST API.

   Personnaly, I use the python script below.

HTH,

Simon.


import requests
import json

BASE_URL = "http://localhost:8083/" // the URL of the server.
url = "" + "api/bootstrap/clientendpoint"   // the client endpoint here !
data = "" {"0": {"shortId": 123,
                          "lifetime": 20,
                          "defaultMinPeriod": 1,
                          "defaultMaxPeriod": None,
                          "disableTimeout": None,
                          "notifIfDisabled": True,
                          "binding": "U"}},
        "security": {"0":{"uri": "coaps://127.0.0.1:5784",
                          "bootstrapServer": False,
                          "securityMode": "PSK",
                          "publicKeyOrId": [115,101,99,117,114,101,95,99,108,105,101,110,116,95,105,100],#represenation of "secure_client_id"
                          "serverPublicKey" : [],
                          "secretKey": [112,114,105,118,97,116,101,95,107,101,121], #binary representation of "private_key", the hexa value is 707269766174655f6b6579
                          "smsSecurityMode": "NO_SEC",
                          "smsBindingKeyParam" : [],
                          "smsBindingKeySecret" : [],
                          "serverSmsNumber" : "+3343577464",
                          "serverId" : 123,
                          "clientOldOffTime" : 1},
                     "1":{"uri": "coap://127.0.0.1:5783",
                          "bootstrapServer": True,
                          "securityMode": "PSK",
                          "publicKeyOrId": [115,101,99,117,114,101,95,99,108,105,101,110,116,95,105,100], #binary represenation of "secure_client_id"
                          "serverPublicKey" : [],
                          "secretKey": [112,114,105,118,97,116,101,95,107,101,121], #binary representation of "private_key", the hexa value is 707269766174655f6b6579
                          "smsSecurityMode": "NO_SEC",
                          "smsBindingKeyParam" : [],
                          "smsBindingKeySecret" : [],
                          "serverSmsNumber" : "+3343577911",
                          "serverId" : 911,
                          "clientOldOffTime" : 20}}}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data="" headers=headers)
print r.status_code
print r.content



Le 19/04/2017 à 13:07, itzik shashuashvili a écrit :
Hello,
TLDR: How do you Bootstrap over COAPS?

Long version: 
We are developing a LWM2M client using a Leshan Demo Sever to test with, we are working on the bootstrapping part and are able to to bootstrap over coap (and are then refereed to a lwm2m server with either coap or coaps).
When I bring the BS server up it clearly says it listens to both coap ad coaps but we are not able to BS over coaps. Is it up on COAPS with some PSK? How do I know what it is?
Itzik.


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top