Posts

Showing posts from April, 2017

HTTPS requests using org.springframework.web.client.RestTemplate

RestTemplate class is useful to make synchronous client-side HTTP access. It also allows you to make HTTPS calls with same interface. When you use HTTPS urls, the framework switch to a different path to take care of the SSL handshake behind the scene so that as a user you don't have to explicitly provide a truststore and keystore to support the protocol. Here are some helpful info to understand the SSL flow better in this case. CA Cert Validation when using org.springframework.web.client.RestTemplate This example uses org.springframework.web.client.RestTemplate to make http requests. This make use of the SSLSocketFactoryImp, and SSLContextImpl$DefaultSSLContext classes, through which get access to the default cacert store file (loaded through X509TrustManagerImpl). Code references: http://www.docjar.com/html/api/sun/security/ssl/SSLContextImpl.java.html  - (DefaultSSLContext-> getDefaultTrustManager) http://www.docjar.com/html/api/sun/security/ssl/TrustManagerFactoryI

IoT: Intel Edison as Bluetooth Low Energy (BLE) peripheral

Image
Intel Edison is one of the best IoT hardware suitable for rapid prototyping. If you are new to IoT world, you can easily setup a simple demo app by using Intel® Edison Kit for Arduino* Box (shown in the picture below). This setup is specifically to create Bluetooth Low Energy (BLE) peripheral with the Intel Edison board. 1. Intel Edison Setup For a new board set up you can follow the step by step instructions given here:  https://software.intel.com/en-us/assembling-intel-edison-board-with-arduino-expansion-board One of the issue I faced with this set up is that, when used the board with USB power mode I had trouble connecting to the box. So its advisable to use a standalone power adapter to avoid intermittent connectivity issues. Some times the Windows 7 will not let you manual/auto install a new build through the USB interface. So you could switch to MAC OS in order to complete the installation process, and then switch to windows if you prefer to. Make sure that the PC is up