[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[leshan-dev] Wakaama secureclient DTLS <-> Leshan bootstrap server
|
Hi,
I'm testing DTSL with the test_psk.py file. When I try to connect leshan bs server with DTLS , leshan bs server say "identity [secure_client_id] is unknown".
I have already run "python test_psk.py" and make sure there is testsecureclient setting in bootstrap.data
Is there anything I need to setup?
Thank you in advance.
Leshan bs server:
Dec 10, 2015 12:02:37 PM org.eclipse.californium.scandium.DTLSConnector receiveNextDatagramFromNetwork
INFO: Aborting handshake with peer [/
172.20.10.2:59392]: Cannot authenticate client, identity [secure_client_id] is unknown
Wakaama secureclient :
ricky@ricky-VirtualBox:~/lwm2m/wakaama/build_secureclient$ ./secureclient -u coap://
172.20.10.11:5684 -i secure_client_id -p 707269766174655f6b6579
Trying to bind LWM2M Client to port 56830
LWM2M Client "testsecureclient" started on port 56830.
Use Ctrl-C to exit.
-Serializing MID 43119 to 0x1b42dc0, Token (len 4) 6F A8 5E F9-
-Serializing options at 0x1b42dc8-
Uri-PathWRITTEN 0 B opt header
Content-Format [40]
OPTION 12 (delta 1, len 1)
WRITTEN 0 B opt header
Uri-QueryWRITTEN 1 B opt header
WRITTEN 0 B opt header
WRITTEN 0 B opt header
-Done serializing at 0x1b42ded----
-Done 111 B (header len 46, payload len 65)-
Dump [0x44 02 A8 6F 6F A8 5E F9]
Dec 10 12:02:38 ALRT 40 invalidate peer
Dec 10 12:02:38 WARN received alert, peer has been invalidated
error dtls handling message -1
error handling message -1
Dec 10 12:02:41 ALRT 40 invalidate peer
Dec 10 12:02:41 WARN received alert, peer has been invalidated
error dtls handling message -1
error handling message -1
import requests
import json
BASE_URL = "http://localhost:8080/"
url = BASE_URL + "api/bootstrap/testsecureclient"
data = {"servers": {"0": {"shortId": 123,
"lifetime": 20,
"defaultMinPeriod": 1,
"defaultMaxPeriod": None,
"disableTimeout": None,
"notifIfDisabled": True,
"binding": "U"}},
"security": {"0":{"uri": "coaps://localhost:5784",
"bootstrapServer": False,
"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"
"serverPublicKeyOrId" : [],
"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://localhost:5683",
"bootstrapServer": True,
"securityMode": "NO_SEC",
"publicKeyOrId": [],
"serverPublicKeyOrId" : [],
"secretKey": [],
"smsSecurityMode": "NO_SEC",
"smsBindingKeyParam" : [],
"smsBindingKeySecret" : [],
"serverSmsNumber" : "+3343577911",
"serverId" : 911,
"clientOldOffTime" : 20}}}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data=json.dumps(data), headers=headers)
print r.status_code
print r.content