Contents ...
udn網路城邦
夏肇毅知識運算網-在物聯網Ubuntu Linux平台IoT gateway上開發 HTTPS 程式
2016/03/31 14:28
瀏覽318
迴響0
推薦3
引用0

[夏肇毅知識運算網 Mark Hsia's Knowledge Computing Web] 夏肇毅部落格



Start building an IoT gateway HTTPS program on the Ubuntu Linux platform

Many ARM IoT platforms support Ubuntu Linux. Once we've selected an IoT gateway hardware board, we then can put this image into the board and start running Ubuntu. This Ubuntu on an IoT board actually is just like your desktop PC. It provides web browser, editors,.., and so on. Once we link the board into internet and enable the auto ethernet from the desktop, we can start our development of the https application program.

First, we should download an openssl example program:

http://www.ibm.com/developerworks/linux/library/l-openssl.html

Then we can start the trial as follows:

-Edit sources.list file
$ sudo vi /etc/apt/sources.list
Insert the following lines:
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe


-Update apt-get
$ sudo apt-get update

-Install gcc and libxml2
$ sudo apt-get install gcc
$ sudo apt-get install libxml2-dev

-Compile program
$ gcc test.c -I/usr/include/libxml2 -lxml2 -o test

-Test program
$ ./test


-Install libssl,pkg-config

$ sudo apt-get install libssl
$ sudo apt-get install pkg-config

-Check libs needed by libssl

$ pkg-config --libs libssl
-lssl -lcrypto



-Compile and link libs

$ gcc nossl.c -I/usr/include -lssl -lcrypto
有誰推薦more

限會員,要發表迴響,請先登入