Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Android: ultralite certificate file

2 posts in Ultralite Last posting was on 2011-07-20 14:26:30.0Z
Merce Chan Posted on 2011-07-17 20:54:02.0Z
Sender: be1.4e1d0d8f.1804289383@sybase.com
From: Merce Chan
Newsgroups: sybase.public.sqlanywhere.ultralite
Subject: Android: ultralite certificate file
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e234bea.2b58.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Jul 2011 13:54:02 -0700
X-Trace: forums-1-dub 1310936042 10.22.241.41 (17 Jul 2011 13:54:02 -0700)
X-Original-Trace: 17 Jul 2011 13:54:02 -0700, 10.22.241.41
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere.ultralite:12559
Article PK: 1048331

Hi,

I have a question on how to use ultralitej HTTPS to
synchronize with back end database.

I have an ultralite Android project setup and in the project
I'm using HTTPS stream to sync with my backend SQL Server
2008 database. However, when I try to execute
com.ianywhere.ultralitejni12.Connection.Synchronize method,
I got an
"com.ianywhere.ultralitejni12.implementation.JniException:
UltraLiteJ Error[-1305]: MobiLink communication error --
code: 207, parameter: , system code: %3" error.

According to the documentation, this means that "No trusted
root certificates were provided". I do have the certificate
file (GoDaddyTrustedRoot,cer). But,
streamParms.setTrustedCertificates() only takes a filename
as it's parameter, my question is ... where should I deploy
the certificate file? I tried using filepath and it didn't
work.

Please advise.
Thanks in advance
Merce Chan


Andy Quick [Sybase] Posted on 2011-07-20 14:26:30.0Z
From: "Andy Quick [Sybase]" <zzzzzzz@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere.ultralite
Subject: Re: Android: ultralite certificate file
References: <4e234bea.2b58.1681692777@sybase.com>
In-Reply-To: <4e234bea.2b58.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e26e596$1@forums-1-dub>
Date: 20 Jul 2011 07:26:30 -0700
X-Trace: forums-1-dub 1311171990 10.22.241.152 (20 Jul 2011 07:26:30 -0700)
X-Original-Trace: 20 Jul 2011 07:26:30 -0700, vip152.sybase.com
Lines: 44
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere.ultralite:12562
Article PK: 1048335


On 17/07/2011 4:54 PM, Merce Chan wrote:
> Hi,
>
> I have a question on how to use ultralitej HTTPS to
> synchronize with back end database.
>
> I have an ultralite Android project setup and in the project
> I'm using HTTPS stream to sync with my backend SQL Server
> 2008 database. However, when I try to execute
> com.ianywhere.ultralitejni12.Connection.Synchronize method,
> I got an
> "com.ianywhere.ultralitejni12.implementation.JniException:
> UltraLiteJ Error[-1305]: MobiLink communication error --
> code: 207, parameter: , system code: %3" error.
>
> According to the documentation, this means that "No trusted
> root certificates were provided". I do have the certificate
> file (GoDaddyTrustedRoot,cer). But,
> streamParms.setTrustedCertificates() only takes a filename
> as it's parameter, my question is ... where should I deploy
> the certificate file? I tried using filepath and it didn't
> work.
>
> Please advise.
> Thanks in advance
> Merce Chan

Merce,

You could either deploy the certificate manually (using eg. adb push) or
package it with your application as a raw resource.

Here is an excellent article on handling certificates:

http://iablog.sybase.com/mobiledatabase/2011/07/https-synchronization-on-android-handling-certificates/

The directory for files private to an application is:
/data/data/<package-name>/files
This directory is obtained with the API call getFilesDir().getPath()

Regards,
--
Andy Quick
Sybase, an SAP Company