Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® Z10

Reply
New Contributor
Fleisch
Posts: 5
Registered: ‎03-21-2013
My Device: BB Z10
My Carrier: o2 (Germany)

Re: CalDAV and CardDAV issues

Got also CalDAV working :Punk:

I don't actually like the solution, but it works...

 

I needed to spend some extra time, because obviously in recent FW (10.0.10.90) things slightly changed.

The ".well-known" standard resource is not used anymore. It was the basis for my first approach.

 

Additionally I found that BB10 handles CalDAV and CardDAV quite differently:

  1. Unlike CardDAV, CalDAV accepts a path in Server field (and uses it), but it doesn't work (I didn't find a valid one)
  2. If BB10 accepts the account settings, it does not mean it works!
    I found it working when I saw existing calendar entries, I was able to create new dates, and they got back to OwnCloud (review with web frontend).

That's what I did (I'm using OwnCloud 5.0 with Apache 2.2, PHP5.3, Linux):

  • In webserver configuration I created two virtual hosts listening on two different ports, both using https(!) and both using OwnCloud's root directory as DocumentRoot. One host serves CalDav requests, the other one CardDAV (in both cases BB10 intially performs the identical requests on "/", thus I use two hosts two distinguish them). Using a GUI this is quite easy...
  • Patch the <OwnCloud>/.htaccess file to redirect HTTP PROPFIND requests to "/" to remote.php/carddav (and caldav, respectively): After the line ReWrite
    <IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{SERVER_PORT} =8082
    RewriteCond %{REQUEST_METHOD} =PROPFIND
    RewriteRule ^$ remote.php/carddav/
    RewriteCond %{SERVER_PORT} =8083
    RewriteCond %{REQUEST_METHOD} =PROPFIND
    RewriteRule ^$ remote.php/caldav/

I chose to rewrite only PROPFIND requests on "/" (other requests couls be forbidden using additional conditions and rules ...)

  • Now OwnCloud would respond with HTTP "403 Forbidden" messages if you try to connect your Z10 with CalDAV or CardDav; for some reason OwnCloud insists on "/remote.php" in the REQUEST_URI.
    I foud a solution in the OwnCloud forum. Zener131 wrote there:
And at the beginning of (root)/remote.php:

require_once('lib/base.php');
// Zener - Fix this in case URL Rewriting was done,
// this appears to break the Webdav notably:
$_SERVER["REQUEST_URI"] = $_SERVER['PHP_SELF'];

...

Now you should be able to connect to OwnCloud. As I wrote, email address does not appear to have any meaning. However, you you must enter something that looks like an email address (e.g. a@b.c). I just creasted a dummy address: <myusername>@<myserver>.<my local domain>

Don't forget the port numbers when entering the server name. Its the usual form <host>:<port>.

That's it.

Please use plain text.
New Contributor
flutiju
Posts: 9
Registered: ‎03-05-2013
My Device: Z10
My Carrier: Free Mobile

Re: CalDAV and CardDAV issues

Congrats !

But I can't get this working :No:

I don't know where the problem come from. Can you past the 2 vhosts settings ? I think that's the problem.

In the .htaccess, I already have a lot of rewrite rules, should I remove them, or just add the new ones ?

Thank you for your support.

Please use plain text.
New Contributor
Fleisch
Posts: 5
Registered: ‎03-21-2013
My Device: BB Z10
My Carrier: o2 (Germany)

Re: CalDAV and CardDAV issues

To check, whether your vhosts work: Just try the OwnCloud's web frontend: e.g. https://yourserver:yourport/

Since "my" RewriteRules wouldn't become effictive (GET method), index.php should be loaded, as usual. You should get OnCloud's login screen.

 

NameVirtualHost *:8082
NameVirtualHost *:8083

Listen 8082
Listen 8083

<VirtualHost *:8082>
	ServerName carddav.qnas.fleisch
	DocumentRoot "/share/Web/owncloud5"
	SSLEngine on
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
	SSLCertificateFile "/etc/stunnel/stunnel.pem"
</VirtualHost>
<VirtualHost *:8083>
	ServerName caldav.qnas.fleisch
	DocumentRoot "/share/Web/owncloud5"
	SSLEngine on
	SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
	SSLCertificateFile "/etc/stunnel/stunnel.pem"
</VirtualHost>

As you can see, I'm using Port 8082, 8083. Actually they originated from my Admin-Tool (my webserver runs on a QNAP NAS)

 

The Listen directives are important to enable the server ports; otherwise the VirtualHosts are quite useless...

The ServerName directives don't appear to have any effects (may be it could  be used in the ReWrite Conditions, instead of checking for Port).

The certificate file can be the "default" file, i.e. the one bing used for normal https transfer via port 443.

 Hint: Replacing "!ADH" with "!DH" in SSCipherSuite allows wireshark to decrypt communication (if it has access to server's private key (stunnel.pem).

 

I guess the existing rewrite rules in .htaccess are important. But in the original file which was contained in the owncloud packeage contained just a few rules... If you added some own rules, make sure that they do not contradict.

Please use plain text.
New Contributor
flutiju
Posts: 9
Registered: ‎03-05-2013
My Device: Z10
My Carrier: Free Mobile

Re: CalDAV and CardDAV issues

[ Edited ]

:Clap:

Thank you so much, it works !

FYI, I had to set the full calendar address in the settings ( https://<myserver>:<myport>/remote.php/caldav/calendars/<login>/<calendarname>).

And by the way, it seems that the problem has been solved in the 10.1.x OS

 

Again, thank you ! :smileyhappy:

Please use plain text.
New Contributor
Fleisch
Posts: 5
Registered: ‎03-21-2013
My Device: BB Z10
My Carrier: o2 (Germany)

Re: CalDAV and CardDAV issues

[ Edited ]

Congratulations!

Adding the path variant did not work for me. I never tried to specify full URL (including "https://") in CalDAV, because it didn't work in CardDAV. However, I didn't try after update to 10.0.10.90.


Using the full URL, you wouldn't even need a dedicated (virtual) CalDAV server; you should be able to use the normal web server.

 

Please use plain text.
New Contributor
Fleisch
Posts: 5
Registered: ‎03-21-2013
My Device: BB Z10
My Carrier: o2 (Germany)

Re: CalDAV and CardDAV issues

I recently found a use of the email field in Calendar settings: If you had setup an email account using the same address, you can send invitations to a meeting's participants. It seems to work with email accounts which are not located on the same server - you don't have to setup your own email server.

Of course, you can only invite contacts which have an email address stored (my list was curiously short...).

Unfortunately you cannot change the address once the calendar account has been setup.

You'd have to setup a new account...

Please use plain text.
Contributor
rblaa
Posts: 15
Registered: ‎04-12-2013
My Device: Z10
My Carrier: Bell

Re: CalDAV and CardDAV issues

[ Edited ]

I finally got CalDav working with Zimbra, everything is good except for one thing: most invites I get are stored with reminders turned off. I have to enable them myself explicitly. Still, it is much much better than having no shared calendar at all, everything else seems to be working, updates sync nicely, etc.

Assuming my email as myuser@mycompany.com, I used settings like this:

User name: myuser@mycompany.com
Email: myuser@mycompany.com
Server: https://mail.mycompany.com/dav/myuser@mycompany.com/Calendar

Please use plain text.
New Developer
New Developer
rzr
Posts: 151
Registered: ‎01-05-2010
My Device: dev alpha c (bb10)
My Carrier: www.rzr.online.fr

Re: CalDAV and CardDAV issues

Please use plain text.
New Contributor
ecsw
Posts: 7
Registered: ‎02-14-2013
My Device: Q10
My Carrier: Telus

Re: CalDAV and CardDAV issues

CalDAV works with this setting, but CardDAV doesn't. 

 

Can anyone in BlackBerry look into this issue? 

Please use plain text.
Contributor
LeBerger
Posts: 12
Registered: ‎05-20-2013
My Device: Z10
My Carrier: o2.de

Re: CalDAV and CardDAV issues

Hi,

on my Z10 calDAV works with Google without any problems.

With OS10.0.10.90 ownCloud also works without any problems with calDAV.

Since the update to 10.1, the events which are synchronized over ownCloud are not complete. Most of them are not visible. No error message (on Z10).

CardDAV works since the update to 10.1, but only one times (it seems so). I've tried to sync in different intervals, but no success. Also no error message (on Z10).

Please use plain text.