Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Unity Web Request mTLS 1.2 - send client certificate

Discussion in 'Editor & General Support' started by v_ribeiro, Mar 9, 2021.

  1. v_ribeiro

    v_ribeiro

    Joined:
    Mar 9, 2021
    Posts:
    4
    Hello all,

    Is there a way to send the client certificate in an UnityWebRequest? Anything similar with HttpWebRequest.ClientCertificates = X509Certificate2Collection ?

    When I try connecting to my server I got HTTP 400 no SSL certificate was sent.

    Thanks!
     
  2. v_ribeiro

    v_ribeiro

    Joined:
    Mar 9, 2021
    Posts:
    4
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    No, UnityWebRequest does not have support for client certificates.
     
  4. Nicolas_TAF

    Nicolas_TAF

    Joined:
    Feb 11, 2021
    Posts:
    9
    I also receive NotImplementedException when trying to use HttpClientHandler.ClientCertificates. Is there any supported API for client certificates?
     
  5. dptaf

    dptaf

    Joined:
    Sep 23, 2022
    Posts:
    14
    Do we have any insight on whether this is something that Unity plans to support in the near future?
     
  6. JasonsFreeTime

    JasonsFreeTime

    Joined:
    May 23, 2015
    Posts:
    31
    I would also like to know if there are any plans to support this.
     
  7. dptaf

    dptaf

    Joined:
    Sep 23, 2022
    Posts:
    14
    for what it's worth i was able to pull this off using System.Net.WebRequest and System.Net.Http.WebRequestHandler. I had to add a link to System.Net.Http.WebRequest.dll in the csc.rsp file to bring in the dll, but I was able to pull of client auth.