plewin / tp-link-modem-router

Goodies for TP-Link modem routers
GNU General Public License v3.0
82 stars 17 forks source link

Use https protocol with send-sms script or rest api bridge #12

Closed s-o-n-i-c-29 closed 3 years ago

s-o-n-i-c-29 commented 3 years ago

Hello Philippe, congratulation for this usefull script to send SMS ; it working fine with http I am currently connecting to the tplink management with the https protocol ; is there a way to use scripts with https protocol (option --url=https) to avoid passing the tplink admin password through the network ? send-sms.js script return "Error CA certificate key too weak"

Thanks

plewin commented 3 years ago

Hey thanks, I'm not sure I have never tried and don't have the router anymore so I can't try. From what I remember, the router certificate is self signed, unchangeable and weak anyway. I guess it might still be possible to use https with this weak encryption by asking nodejs to ignore https issues.

How to do that should be

""" process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; """

Between the shebang and the code inside a script. If you are still willing to do that, could you please test?

Best regards,

s-o-n-i-c-29 commented 3 years ago

Hello,

thank you for your quick feedback ; i confirm you the router TP-Link MR600 could provides you a self signed certificate file CACert.crt for remote HTTPs management ; the test is a success by adding these lines after the sheban, good job ;)

""" // ignore https issues process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; """

# example passing all arguments as command line args ./sms-send.js --url="https://10.x.x.x" --login="admin" --password="myrouterpassword""06xxxxxx""my text message"

Have a nice day, Best Regards,