網路城邦
上一篇 回創作列表 下一篇   字體:
夏肇毅知識運算網-在物聯網Ubuntu Linux平台IoT gateway上開發 HTTPS 程式
2016/03/31 14:28:32瀏覽283|回應0|推薦3

[夏肇毅知識運算網 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
( 知識學習隨堂筆記 )
回應 推薦文章 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=markhsia&aid=51940727