Bug 23470 - Error 403 thrown after second certificate is loaded on an Azure call
Summary: Error 403 thrown after second certificate is loaded on an Azure call
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.0.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2014-09-29 18:31 UTC by Cody Beyer (MSFT)
Modified: 2017-01-17 18:19 UTC (History)
10 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Sadik Ali 2014-09-30 03:33:07 UTC
I have checked this issue and able to reproduce. To reproduce this issue I have followed the steps mentions below:

1. Open attached sample application in XS
2. Build and deploy it on device
3. It will deploy and you will see a button
4. When it start new webrequest...
5. You will  get exception thrown in application output

Application Output: https://gist.github.com/Rajneesh360Logica/d64e49d12b227dc4049b

Screencast: http://www.screencast.com/t/JkajpdyI8t

Environment Info:

=== Xamarin Studio ===

Version 5.4 (build 240)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
	Mono 3.10.0 ((detached/53e3161)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000018

=== Xamarin.Android ===

Version: 4.16.0 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 58b46df
Build date: 2014-09-18 22:32:07-0400

=== Xamarin.Mac ===

Version: (Starter Edition)

=== Build Information ===

Release ID: 504000240
Git revision: 01786bc67c7024ec33d327ed27e4416d7a846f4e
Build date: 2014-09-17 10:58:48-04
Xamarin addins: 7cd7dfcd6b7b7b53281508954ec080f1cd153ad3

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2014-09-30 13:46:33 UTC
First call from attached sample does not succeed. In fact they all fail.

Note: the logs from comment #1 does NOT show any success. The *described* behavour was not reproduced.
Comment 3 Cody Beyer (MSFT) 2014-09-30 13:48:39 UTC
I was only able to get it to reproduce when running on a device, NOT within the simulators. Can Sadik retry with a device as described in the description?
Comment 4 Sebastien Pouliot 2014-09-30 13:53:54 UTC
I followed your steps and it did not work on devices for me (same as simulator, as expected). If dev can't reproduce it then it can't be fixed.
Comment 5 Sadik Ali 2014-10-01 09:31:32 UTC
I have also checked it with both simulator and device as well. At my end, all web request calls are getting failed.
Comment 7 Cody Beyer (MSFT) 2014-10-03 00:11:04 UTC
Reworked and verified new attachment, TestCaseVerified, recreates the bug as described. Please verify. Thanks
Comment 8 Cody Beyer (MSFT) 2014-10-03 00:20:51 UTC
Bug also exists in Android. See attachment "AndroidAzure403"
Comment 10 Sebastien Pouliot 2014-10-03 09:17:39 UTC
wrt comment #8 it means it's a Mono bug in the HTTP stack -> Martin

From the description it sounds like the connection caching might not consider the client certificate. So the first call works (and is cached) and the next one fails (because the first is reused, while the data is invalid).
Comment 12 Brendan Zagaeski (Xamarin Team, assistant) 2015-02-19 15:27:55 UTC
As a caution, note that the Azure subscription URL + client certificate pairs in the attached test cases have expired, so it will be necessary to set up 2 new URLs (each of which uses a different client certificate for authentication) before trying either of the test cases.
Comment 14 Martin Baulig 2016-11-11 09:59:08 UTC
There have been a ton of fixes in the related code during the past year - do you still have this problem?
Comment 15 Manuel de la Peña [MSFT] 2016-12-16 11:09:39 UTC

@Cody if you are still experiencing this issue? If not we should close it.
Comment 16 Timothy Risi 2017-01-17 18:19:09 UTC
Closing this bug since there's been no response.  If you are still experiencing this issue please re-open the bug report and let us know what you are seeing now. Thanks!