xamarin-macios icon indicating copy to clipboard operation
xamarin-macios copied to clipboard

[Foundation] Implement the server certificate custom validation callback usage in NSUrlSessionHandler

Open simonrozsival opened this issue 2 years ago • 33 comments

We recently implemented the ServerCertificateCustomValidationCallback in Xamarin.Android (https://github.com/xamarin/xamarin-android/pull/6665). It would be great to have feature parity and support the same callback in Xamarin.iOS and Xamarin.Mac.

Related to https://github.com/dotnet/runtime/issues/68898.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/14632.

simonrozsival avatar May 25 '22 08:05 simonrozsival

/azp run

mandel-macaque avatar May 25 '22 17:05 mandel-macaque

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 25 '22 17:05 azure-pipelines[bot]

:fire: [PR Build] Build failed :fire:

Build failed for the job 'Generate API diff'

Pipeline on Agent Hash:

:fire: [PR Build] Build failed :fire:

Build failed for the job 'Build packages'

Pipeline on Agent Hash:

The build fails with:

Foundation/NSUrlSessionHandler.cs(885,102): error CS1061: 'NSUrlSessionHandler' does not contain a definition for 'ServerCertificateCustomValidationCallback' and no accessible extension method 'ServerCertificateCustomValidationCallback' accepting a first argument of type 'NSUrlSessionHandler' could be found (are you missing a using directive or an assembly reference?)
Foundation/NSUrlSessionHandler.cs(974,24): error CS1061: 'NSUrlSessionHandler' does not contain a definition for 'ServerCertificateCustomValidationCallback' and no accessible extension method 'ServerCertificateCustomValidationCallback' accepting a first argument of type 'NSUrlSessionHandler' could be found (are you missing a using directive or an assembly reference?)
Foundation/NSUrlSessionHandler.cs(1007,27): error CS1061: 'NSUrlSessionHandler' does not contain a definition for 'ServerCertificateCustomValidationCallback' and no accessible extension method 'ServerCertificateCustomValidationCallback' accepting a first argument of type 'NSUrlSessionHandler' could be found (are you missing a using directive or an assembly reference?)
make[1]: *** [build/watch/reference/Xamarin.WatchOS.dll] Error 1

rolfbjarne avatar May 25 '22 21:05 rolfbjarne

/azp run

simonrozsival avatar Sep 05 '22 10:09 simonrozsival

Commenter does not have sufficient privileges for PR 15117 in repo xamarin/xamarin-macios

azure-pipelines[bot] avatar Sep 05 '22 10:09 azure-pipelines[bot]

@mandel-macaque I don't have permissions to run CI in this repo. Could you please re-run the tests for my latest changes?

simonrozsival avatar Sep 05 '22 10:09 simonrozsival

/azp run

rolfbjarne avatar Sep 05 '22 10:09 rolfbjarne

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 05 '22 10:09 azure-pipelines[bot]

:books: [PR Build] Artifacts :books:

Artifacts were not provided.

Pipeline on Agent XAMMINI-007.Monterey Hash: f9a46f4dc3e10b57c745a461405500a71a84e346 [PR build]

:x: [PR Build] Tests on macOS Mac Catalina (10.15) failed :x:

Failed tests are:

  • monotouch-test

Pipeline on Agent Hash: f9a46f4dc3e10b57c745a461405500a71a84e346 [PR build]

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • ~iOS~ (no change detected)
  • ~tvOS~ (no change detected)
  • ~watchOS~ (no change detected)
  • ~macOS~ (no change detected)
NET (empty diffs)
  • ~iOS~: (empty diff detected)
  • ~tvOS~: (empty diff detected)
  • ~MacCatalyst~: (empty diff detected)
  • ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

:white_check_mark: Generator diff

Generator diff is empty

Pipeline on Agent Hash: f9a46f4dc3e10b57c745a461405500a71a84e346 [PR build]

:x: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed :x:

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent Hash: f9a46f4dc3e10b57c745a461405500a71a84e346 [PR build]

@mandel-macaque @rolfbjarne could someone run the tests for me one more time please? 😄

BTW what would I need to do to enable CI runs for my commits and PRs? Do I need to join some organization/group/team on Github or AzDO?

simonrozsival avatar Sep 08 '22 12:09 simonrozsival

/azp run

rolfbjarne avatar Sep 08 '22 13:09 rolfbjarne

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 08 '22 13:09 azure-pipelines[bot]

BTW what would I need to do to enable CI runs for my commits and PRs? Do I need to join some organization/group/team on Github or AzDO?

That's a good question. Maybe @dalexsoto knows?

In the meantime feel free to ping me whenever you do a commit and I'll trigger the CI.

rolfbjarne avatar Sep 08 '22 13:09 rolfbjarne

:books: [PR Build] Artifacts :books:

Packages generated

View packages

Pipeline on Agent XAMBOT-1104.Monterey' Hash: 65a2df397b7e09a910e4a42345b8480aa35ba9c4 [PR build]

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • ~iOS~ (no change detected)
  • ~tvOS~ (no change detected)
  • ~watchOS~ (no change detected)
  • ~macOS~ (no change detected)
NET (empty diffs)
  • ~iOS~: (empty diff detected)
  • ~tvOS~: (empty diff detected)
  • ~MacCatalyst~: (empty diff detected)
  • ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

:white_check_mark: Generator diff

Generator diff is empty

Pipeline on Agent Hash: 65a2df397b7e09a910e4a42345b8480aa35ba9c4 [PR build]

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent Hash: 65a2df397b7e09a910e4a42345b8480aa35ba9c4 [PR build]

@rolfbjarne I don't understand what happened with all the simulator tests - they all fail at the Install dotnet workloads step. Is that caused by some of my changes or is that some infra flakiness?

simonrozsival avatar Sep 09 '22 15:09 simonrozsival

/azp run

rolfbjarne avatar Sep 09 '22 15:09 rolfbjarne

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 09 '22 15:09 azure-pipelines[bot]

@simonrozsival that's a known issue we had in CI for a little while. I've merged main (where the issue is fixed) into your branch, and triggered a new build. Hopefully it goes better :)

rolfbjarne avatar Sep 09 '22 15:09 rolfbjarne

@rolfbjarne I see, thanks 😄

simonrozsival avatar Sep 09 '22 15:09 simonrozsival

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • ~iOS~ (no change detected)
  • ~tvOS~ (no change detected)
  • ~watchOS~ (no change detected)
  • ~macOS~ (no change detected)
NET (empty diffs)
  • ~iOS~: (empty diff detected)
  • ~tvOS~: (empty diff detected)
  • ~MacCatalyst~: (empty diff detected)
  • ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

:white_check_mark: Generator diff

Generator diff is empty

Pipeline on Agent Hash: cee43a2638503941800ae6008c98244a35b2015f [PR build]

:computer: [PR Build] Tests on macOS Mac Catalina (10.15) passed :computer:

:white_check_mark: All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent Hash: cee43a2638503941800ae6008c98244a35b2015f [PR build]

:books: [PR Build] Artifacts :books:

Packages generated

View packages

Pipeline on Agent XAMBOT-1103.Monterey' Hash: cee43a2638503941800ae6008c98244a35b2015f [PR build]

:x: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed :x:

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent Hash: cee43a2638503941800ae6008c98244a35b2015f [PR build]