Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • LibVLCSharp LibVLCSharp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 76
    • Issues 76
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLAN
  • LibVLCSharpLibVLCSharp
  • Issues
  • #530

Closed
Open
Created Dec 22, 2021 by Alex Shu@Shubaka

Can't skip tls certificate confirmation, and workaround SetDialogHandlers causes crash

Hi, I'm trying to get https mjpeg streams in wpf application, the server certificate is self signed and gives me a lot of trouble. The vlc code runs in a console application, I thought it has something to do with it so I migrated it to WinForm app, still the same.

Latest versions of LibVlc, LibVlcSharp and LibVlcSharp.WPF Basically I'm trying to resolve my issues that described in Issue #48 but it doesn't work.

  1. When I'm trying to set a trusted certificate folder with --gnutls-dir-trust certificateFolder it recognizes the certificate in the folder but the certificate doesn't match (I saved it using Chrome developer tools) and gives me an error.
[04fc9cb0] gnutls tls client debug: loaded 1 trusted CAs from C:\cert
[04fc9cb0] main tls client debug: using tls client module "gnutls"
[04fc9cb0] main tls client debug: resolving 192.168.1.1 ...
[04fc9cb0] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[04fc9cb0] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[04fc9cb0] gnutls tls client debug: TLS handshake: Success.
[04fc9cb0] gnutls tls client debug:  - safe renegotiation (RFC5746) enabled
[04fc9cb0] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The name in the certificate does not match the expected.
  1. When I'm trying to skip the confirmation with --no-gnutls-system-trust it seems that its just ignoring the this and gives me the following:
[05166f68] main stream debug: looking for access module matching "https": 27 candidates
[05166f68] main stream warning: Password in a URI is DEPRECATED
[051770c8] main tls client debug: looking for tls client module matching "any": 1 candidates
[051770c8] gnutls tls client debug: using GnuTLS version 3.6.15
[051770c8] main tls client debug: using tls client module "gnutls"
[051770c8] main tls client debug: resolving 192.168.1.1 ...
[051770c8] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[051770c8] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[051770c8] gnutls tls client debug: TLS handshake: Success.
[051770c8] gnutls tls client debug:  - safe renegotiation (RFC5746) enabled
[051770c8] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected.
[051770c8] gnutls tls client debug: 1 certificate(s) in the list
[051770c8] gnutls tls client debug: no known certificates for 192.168.1.1
[051770c8] main tls client error: TLS session handshake error
[051770c8] main tls client error: connection error: No error
[05166f68] access stream error: HTTP connection failure
[05166f68] main stream debug: no access modules matched
[052195f0] main input error: לא ניתן לפתוח את הקלט שלך
[052195f0] main input error: הכתובת הבאה לא נפתחה על ידי VLC 'https://user:verysecure!@192.168.1.1:7001/media/b53f677c-ae26-426f-8b87-40275ff64bb5.mpjpeg'. יש לעיין ביומן לקבלת פרטים.
  1. When I'm using SetDialogHandlers it crashes when trying to open the stream like in Issue #275

I set it like this:

Core.Initialize();
_libvlc = new LibVLC(new [] { /*"--gnutls-dir-trust", "C:\\cert",*/ /*"--no-gnutls-system-trust",*/"--verbose=2" });              
_libvlc.SetDialogHandlers(Error, Login, Question, DisplayProgress, UpdateProgress);

I do have the libvlc dlls in the current directory, even tried to explicitly direct to it with Core.Initialize(path); and this is the log, nothing new...

[0597f8c8] main tls client debug: using tls client module "gnutls"
[0597f8c8] main tls client debug: resolving 192.168.1.1 ...
[0597f8c8] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[0597f8c8] gnutls tls client debug: TLS handshake: Resource temporarily unavailable, try again.
[0597f8c8] gnutls tls client debug: TLS handshake: Success.
[0597f8c8] gnutls tls client debug:  - safe renegotiation (RFC5746) enabled
[0597f8c8] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The name in the certificate does not match the expected.
[0597f8c8] gnutls tls client debug: 1 certificate(s) in the list
[0597f8c8] gnutls tls client debug: no known certificates for 192.168.1.1
Press any key to continue . . .

when I ran the code in WinWorm app I got an Access Violation exception in the Output window, but no other info.

Any help or directions is greatly appreciated.

Edited Dec 22, 2021 by Alex Shu
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking

VideoLAN code repository instance