Nov 24

We were recently setting up an automated data transfer for a client. Standard sort of thing with a file being periodically copied from one server to another, then processed on that server. When we tested it we found the processing was failing.

Closer investigation revealed the issue was that the file transferred from client server was using UTF-16 encoding and the processing was UTF-8. There was no need for the files to be in UTF-16 so the solution was to convert them to UTF-8. To achieve that we used the iconv utility using the following syntax


iconv --from-code UTF-16 --to-code UTF-8 input_utf16.xml > output_utf8.xml

written by objects \\ tags: , ,

May 28

Recently was setting up clients iPhone to access our mail servers using IMAP over SSL. Problem was we kept getting an error say that the username or password were incorrect. The username and password entered in the iPhone setup were correct. Using the identical setup to access the same email account from my iPhone worked fine.

Fortunately we had setup the phone so that all it’s data was either being accessed or synced from the cloud so resetting the phone was no drama. Unfortunately resetting his phone didn’t make any difference, still could not connect.

After increasing the logging on the mail server it was discovered the issue was that the iPhone did not have the required SSL certificate installed to make the required connection. The reason my iPhone worked I think is because I sync mine with a Mac whereas the phone that could not connect was syncing with a Windows box. Am assuming that the syncing with the Mac copied the certificate to my iPhone for me, but have not confirmed this.

To install the certificate we took the following steps.

  1. Create a DER format certificate

    iPhone does not understand PEM (Privacy-Enhanced Mail) formatted certificates and instead expects the certificate to be in DER (Distinguished Encoding Rules) format. So we need to create a DER version of the mail certificate on the server using openssl.

    openssl x509 -in /etc/ssl/certs/ssl-mail.pem -inform PEM -out mail.der -outform DER

  2. Copy the DER certificate so it is accessible from your web server

  3. Open the certificate on your iPhone

    Using Safari on the iPhone open the certificate that you just created. You will be prompted if you want to install the certificate. Press the “Install” button to install the certificate on your iPhone.

  4. Reboot your iPhone

    After restarting the iPhone the certificate should be available and you will be able to connect to the mail server using SSL without any problems.

written by Obiweb \\ tags: , , , , , ,

May 27

Previously we covered passing command line arguments to Ant. We can use that to specify the value to be used for arg tag values. Here is an example:

ant -Dargstring="-test -abc file.out" build

In the build script we have the following:

  <java classname="test.Main" fork="yes" >
    <arg value="${argstring}"/>
  </java>

This will result in the arguments “-test -abc file.out” being passed to the java call in the build script.

written by objects \\ tags: , , , ,