{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2338","repository_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2338/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2338/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2338/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/2338","id":310316144,"number":2338,"title":"MQTT over TLS with ECC ","user":{"login":"joysfera","id":2862144,"avatar_url":"https://avatars3.githubusercontent.com/u/2862144?v=4","gravatar_id":"","url":"https://api.github.com/users/joysfera","html_url":"https://github.com/joysfera","followers_url":"https://api.github.com/users/joysfera/followers","following_url":"https://api.github.com/users/joysfera/following{/other_user}","gists_url":"https://api.github.com/users/joysfera/gists{/gist_id}","starred_url":"https://api.github.com/users/joysfera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joysfera/subscriptions","organizations_url":"https://api.github.com/users/joysfera/orgs","repos_url":"https://api.github.com/users/joysfera/repos","events_url":"https://api.github.com/users/joysfera/events{/privacy}","received_events_url":"https://api.github.com/users/joysfera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-01T11:17:09Z","updated_at":"2018-04-01T18:11:36Z","closed_at":null,"author_association":"NONE","body":"This may not be a real bug report (yet) but I've just failed to test my idea how to save precious memory with TLS connection and I don't know if it is my fault or NodeMCU's. In #1699 I found out that MQTT over secure connection takes about 17 kB of memory on the heap. The idea is to try out installing ECC certificate on the MQTT server to see if it saves memory on the NodeMCU client as well.\r\n\r\nECC https://wiki.openssl.org/index.php/Elliptic_Curve_Cryptography uses 6-30 times shorter keys (e.g. 224 bytes instead of 2 kB) so there's hope to save memory, right?\r\n\r\n### Expected behavior\r\nNodeMCU MQTT connects and proceeds normally.\r\n\r\n### Actual behavior\r\nMQTT fails to connect with reason = -5\r\n\r\nFYI, at the same time the Mosquitto on the server reports this:\r\n```\r\n1522578760: Client connection failed: error:1417A0C1:SSL routines:tls_post_process_client_hello:no shared cipher.\r\n```\r\n\r\n### Test code\r\n```Lua\r\nm=mqtt.Client(node.chipid(), 120)\r\nm:connect(\"eccbroker\", 8883, 1, 0, function(c) print(\"OK\") end, function(c, r) print(r) end)\r\n```\r\nmosquitto_pub connects OK so the broker is configured well.\r\n\r\nNodeMCU used to connect to my broker OK until I replaced the SSL certificates with ECC ones (generated by LE using ACME.sh).\r\n\r\n### NodeMCU version\r\nLua 5.1.4 on SDK 2.2.1(cfd48f3)\r\nbranch: dev  commit: 9af4f58417103a21d31f70fc6e44bfba55d36789\r\n\r\n### Hardware\r\nplain ESP8266 v07"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/377805587","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/2338#issuecomment-377805587","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2338","id":377805587,"user":{"login":"TerryE","id":690173,"avatar_url":"https://avatars3.githubusercontent.com/u/690173?v=4","gravatar_id":"","url":"https://api.github.com/users/TerryE","html_url":"https://github.com/TerryE","followers_url":"https://api.github.com/users/TerryE/followers","following_url":"https://api.github.com/users/TerryE/following{/other_user}","gists_url":"https://api.github.com/users/TerryE/gists{/gist_id}","starred_url":"https://api.github.com/users/TerryE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerryE/subscriptions","organizations_url":"https://api.github.com/users/TerryE/orgs","repos_url":"https://api.github.com/users/TerryE/repos","events_url":"https://api.github.com/users/TerryE/events{/privacy}","received_events_url":"https://api.github.com/users/TerryE/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T18:11:35Z","updated_at":"2018-04-01T18:11:35Z","author_association":"COLLABORATOR","body":"I've just made this point on another issue, but I've really got to ask myself:  we we expect LUA application developers to implement LTS or MQTT over TLS without it?\r\n\r\nIf the answer is no, then wat some point in the near future, we should just embrace the fact that you can't run TLS without LFS enables and exploit LFS to simplify the implementation. "}}
{"actor":{"display_login":"TerryE"}}