Sunday, September 18, 2011

Compiling Open SSL programs in Eclipse

If you attempt to compile an SSL related project on Eclipse , you are most likely going to get any of the following errors:

undefined reference to `ERR_load_crypto_strings'
undefined reference to `PEM_read_PrivateKey'
undefined reference to `ERR_print_errors_fp'
undefined reference to `EVP_sha1'
undefined reference to `EVP_DigestInit'
undefined reference to `EVP_DigestUpdate'
undefined reference to `EVP_SignFinal'
undefined reference to `ERR_print_errors_fp'
undefined reference to `EVP_PKEY_free'
undefined reference to `PEM_read_X509'
undefined reference to `ERR_print_errors_fp'
undefined reference to `X509_get_pubkey'
undefined reference to `ERR_print_errors_fp'
undefined reference to `EVP_sha1'
undefined reference to `EVP_DigestInit'
undefined reference to `EVP_DigestUpdate'
undefined reference to `EVP_VerifyFinal'
undefined reference to `EVP_PKEY_free'
undefined reference to `ERR_print_errors_fp'


Although your project is configured to include all the libraries that are in the /usr/include path, its still not configured to link against those libraries when generating the binary file for your project. We need to tell the linker that our project is using the openssl libraries.

Solution:

  1. Go to Project > Properties
  2. Navigate to C/C++ Build > Settings
  3. Go to GCC C Linker  > Miscellaneous settings
  4. Add the following in the Linker flags : -lcrypto -lssl
 

Thursday, September 15, 2011

Database Access and Google Web Toolkit (GWT)

Google has a tight restriction over accessing third-party API and running it through their Google App Engine. They have defined a list of Java API that "Will play in the App Engine.". They call the list the JRE white list. From the list you can see that JDBC is not included which doesnt allow any external database access to the system. Google made it explicitly clear that such third party packages running in the App Engine could create a security problem for it.

Solution:

The only solution is to run your web app through another contanier such as Tomcat. What can make your life much easier in debugging at that point is to have the Eclipse GWT plugin forward the debug requests from Tomcat to the Eclipse IDE. Google was kind enough to give the steps necessary to debug on containers such as Tomcat through eclipse.

[Update]

Google has released a solution for accessing databases through thier Google Cloud DB. Details could be found in this Link