Error: SecureChannelFailure (The authentication or decryption has failed.)

SauravAnandSauravAnand USMember ✭✭

Hi,

I'm trying to make a POST request with httpWebRequest on Https endpoint but this gives me exception like: System.Net.WebException "SecureChannelFailure (The authentication or decryption has failed.)"

Xamarin Mac Project's target framework is : Mono/.Net 4.5
Mono Framework:4.8.1

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) // i'm getting exception on this line.
{
string json = jsonWhere;
streamWriter.Write(json);
}

My Application was working fine 1 day ago and i didn't make any changes but now i'm getting this error.
Any help would be much appreciated.

Thanks,
Saurav

Tagged:

Answers

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    If possible, I would recommend trying a newer version of the Mono Framework MDK to see if that resolves the issue. There have been several improvements in the TLS protocol handling since Mono Framework MDK version 4.8.1. One possible cause of the change in behavior you are seeing could be that a change was made in the server-side TLS settings that is not supported properly in the older Mono Framework MDK version 4.8.1. It is quite possible that a more recent version of Mono would support those settings.

  • SauravAnandSauravAnand USMember ✭✭

    @BrendanZagaeski Thank you for the response. I have updated Mono Framework MDK to newer version and my issue is got resolved :) I have few queries such as:

    1)Currently my Mac Desktop application's target framework is: Mono/.Net 4.5 (which is marked as unsupported), i would like to ask you that can i be sure that my application targeting mentioned framework will be continue to use with no issues and not necessary to migrate to any other framework (Xamarin.Mac .Net 4.5 or so)?

    2)After Mono update my other Xamarin.Mac projects couldn't build successfully and giving me error [MMP: error MM5109: Native linking failed with error code 1. Check build log for details.].

    -This project's targeted framework is Mono/.Net 4.5
    -Supported architecture x86_64

    I have googled and found solution like add --registrar:dynamic under Additional mmp Arguments but this didn't resolve the issue. Any idea how do resolve please?

    Thank you.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Let me take a crack at answering your questions:

    • So we call it unsupported for a reason, we don't necessarily support it to the same level as Full and Modern. We don't do really any QA on it. We're not likely to intentionally break it, and we may fix issues, as they come up, but if at all possible I would suggest moving to Full.
    • Native linking failed doesn't tell me anything without the part you didn't copy from the full log (Check build log for details). All it says is "the clang invocation failed somehow".

    A full build log would be helpful, but a small self contained project showing the error would be even better.

  • SauravAnandSauravAnand USMember ✭✭
    edited May 2018

    @ChrisHamons Thank you. I have checked Xamarin > Help > log directory, but couldn't find related errors. I'm providing you the Build Output below:

    MMP:  warning MM2006: Native library 'libasound' was referenced but could not be found.
    MMP:  warning MM2006: Native library 'api-ms-win-core-timezone-l1-1-0.dll' was referenced but could not be found.
    MMP:  warning MM2006: Native library 'odbc32.dll' was referenced but could not be found.
            /Library/Frameworks/Mono.framework/Commands/pkg-config --cflags mono-2
            -D_THREAD_SAFE -I/Library/Frameworks/Mono.framework/Versions/5.8.1/lib/pkgconfig/../../include/mono-2.0  
    
            /Library/Frameworks/Mono.framework/Commands/pkg-config --variable=libdir mono-2
            /Library/Frameworks/Mono.framework/Versions/5.8.1/lib/pkgconfig/../../lib
    
            /Library/Frameworks/Mono.framework/Commands/pkg-config --modversion mono-2
            5.8.1
    
    
            ld: framework not found MetalPerformanceShaders
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    MMP: error MM5109: Native linking failed with error code 1.  Check build log for details.
        Task "Mmp" execution -- FAILED
        Done building target "_CompileToNative" in project "/Users/vaibhavdomkundwar/Projects/savtest1/savtest1/savtest1.csproj".-- FAILED
    
    Done building project "/Users/vaibhavdomkundwar/Projects/savtest1/savtest1/savtest1.csproj".-- FAILED
    
    Build FAILED.
    
    Warnings:
    
    /Users/vaibhavdomkundwar/Projects/savtest1/savtest1/savtest1.csproj (Build) ->
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets (_CompileToNative target) ->
    
        MMP:  warning MM2006: Native library 'libasound' was referenced but could not be found.
        MMP:  warning MM2006: Native library 'api-ms-win-core-timezone-l1-1-0.dll' was referenced but could not be found.
        MMP:  warning MM2006: Native library 'odbc32.dll' was referenced but could not be found.
    
    Errors:
    
    /Users/vaibhavdomkundwar/Projects/savtest1/savtest1/savtest1.csproj (Build) ->
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets (_CompileToNative target) ->
    
        MMP: error MM5109: Native linking failed with error code 1.  Check build log for details.
    

    Please help. Let me know if any further input is required from my side.
    Thank you.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    ld: framework not found MetalPerformanceShaders

    Those were added in 10.13.

    What macOS are you building on?
    Do you know what Xamarin.Mac you were using before?

  • SauravAnandSauravAnand USMember ✭✭

    @ChrisHamons

    My Current macOS: 10.12.6
    Current Xamarin.Mac: Version: 4.2.1.29
    Previous Xamarin.Mac: 3.2.0.175

  • SauravAnandSauravAnand USMember ✭✭

    Hi Chris,

    Could you please help me in this issue. I googled & tried various solutions but none of those worked for me. Prior installation of Visual Studio for Mac everything was fine & working but post installation components got updated and now my other Xamarin.Mac project doesn't build successfully.

    Please suggest me what to try next. I need to fix it ASAP.

    Thank you.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Xamarin.Mac 3.2 was released over a year ago, and we've had a number of releases since then (3.4, 3.6, 3.8, 4.0, 4.2, 4.4).

    As a short term fix you could always downgrade to 3.4 (https://dl.xamarin.com/XamarinforMac/Mac/xamarin.mac-3.4.0.36.pkg).

    That sort of error sounds like you are building against a new SDK, or not but expecting to. What Xcode are you building against?

Sign In or Register to comment.