Jump to content

https StartSSl pfx Exception loading certificate


mdean1120
 Share

Recommended Posts

I am running MB3 server through omv (debian).   I updated and got the latest Beta with https support.  I have a StartSSL cert I use for external access in omv.    I created a pfx and have loaded it into MB3, but I get an exception when MB3 tries to load the certificate.

 

 

2015-02-12 22:07:51.0890 Info - HttpServer: Adding HttpListener prefix http://+:8096/
2015-02-12 22:07:51.0890 Info - HttpServer: Adding HttpListener prefix https://+:8920/
2015-02-12 22:07:51.0954 Info - HttpServer: attempting to load pfx: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/MediaBrowser/dean1120.net.pfx
2015-02-12 22:07:51.1126 Error - HttpServer: Exception loading certificate: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/MediaBrowser/mine.pfx
    *** Error Report ***
    Version: 3.0.5518.3
    Command line: /opt/mediabrowser/MediaBrowser.Server.Mono.exe -programdata /var/lib/mediabrowser
    Operating system: Unix 3.2.0.4
    Processor count: 4
    64-Bit OS: True
    64-Bit Process: True
    Program data path: /var/lib/mediabrowser
    Mono: 3.12.0 (tarball Sat Feb 7 19:12:57 UTC 2015)
    Application Path: /opt/mediabrowser/MediaBrowser.Server.Mono.exe
    Input data cannot be coded as a valid certificate.
    System.Security.Cryptography.CryptographicException
     at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0
     at Mono.Security.X509.X509Certificate..ctor (System.Byte[] data) [0x00000] in <filename unknown>:0
     at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.Byte[] rawData, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0
     at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.String fileName, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0
     at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor (System.String fileName) [0x00000] in <filename unknown>:0
     at SocketHttpListener.Net.EndPointListener.LoadCertificateAndKey (System.Net.IPAddress addr, Int32 port, System.String certificateLocation) [0x00000] in <filename unknown>:0
    InnerException: System.Security.Cryptography.CryptographicException
    Input data cannot be coded as a valid certificate.
     at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0
    
2015-02-12 22:07:51.5959 Info - ServerWMC: Config IP: mediacenter (192.168.15.11), Config Port: 9080
2015-02-12 22:07:51.5978 Info - ServerWMC: Running in Linux, Linux path to mounted RecTV directory: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/RecordedTV
2015-02-12 22:07:51.8799 Info - App: Core startup complete
2015-02-12 22:07:51.9846 Debug - PortMapper: Starting NAT discovery
2015-02-12 22:07:52.0385 Info - Dlna: SSDP service started
2015-02-12 22:07:52.0581 Debug - Dlna: Starting alive notifier

 

Does anyone have any idea on what might be wrong?   

 

Thanks,

 

 

 
Link to comment
Share on other sites

  • 3 weeks later...

I am running MB3 server through omv (debian). I updated and got the latest Beta with https support. I have a StartSSL cert I use for external access in omv. I created a pfx and have loaded it into MB3, but I get an exception when MB3 tries to load the certificate.

 

 

2015-02-12 22:07:51.0890 Info - HttpServer: Adding HttpListener prefix http://+:8096/

2015-02-12 22:07:51.0890 Info - HttpServer: Adding HttpListener prefix https://+:8920/

2015-02-12 22:07:51.0954 Info - HttpServer: attempting to load pfx: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/MediaBrowser/dean1120.net.pfx

2015-02-12 22:07:51.1126 Error - HttpServer: Exception loading certificate: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/MediaBrowser/mine.pfx

*** Error Report ***

Version: 3.0.5518.3

Command line: /opt/mediabrowser/MediaBrowser.Server.Mono.exe -programdata /var/lib/mediabrowser

Operating system: Unix 3.2.0.4

Processor count: 4

64-Bit OS: True

64-Bit Process: True

Program data path: /var/lib/mediabrowser

Mono: 3.12.0 (tarball Sat Feb 7 19:12:57 UTC 2015)

Application Path: /opt/mediabrowser/MediaBrowser.Server.Mono.exe

Input data cannot be coded as a valid certificate.

System.Security.Cryptography.CryptographicException

at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0

at Mono.Security.X509.X509Certificate..ctor (System.Byte[] data) [0x00000] in <filename unknown>:0

at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.Byte[] rawData, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0

at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.String fileName, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0

at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor (System.String fileName) [0x00000] in <filename unknown>:0

at SocketHttpListener.Net.EndPointListener.LoadCertificateAndKey (System.Net.IPAddress addr, Int32 port, System.String certificateLocation) [0x00000] in <filename unknown>:0

InnerException: System.Security.Cryptography.CryptographicException

Input data cannot be coded as a valid certificate.

at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0

 

2015-02-12 22:07:51.5959 Info - ServerWMC: Config IP: mediacenter (192.168.15.11), Config Port: 9080

2015-02-12 22:07:51.5978 Info - ServerWMC: Running in Linux, Linux path to mounted RecTV directory: /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/RecordedTV

2015-02-12 22:07:51.8799 Info - App: Core startup complete

2015-02-12 22:07:51.9846 Debug - PortMapper: Starting NAT discovery

2015-02-12 22:07:52.0385 Info - Dlna: SSDP service started

2015-02-12 22:07:52.0581 Debug - Dlna: Starting alive notifier

 

Does anyone have any idea on what might be wrong?

 

Thanks,

 

 

Did you ever get this sorted? The most likely scenario is the pfx wasn't generated right or its password protected. We will self generate a cert if one doesn't exist.

Link to comment
Share on other sites

This is happening for me when I moved my installation from Centos 7 to Ubuntu 14.04 

 HttpServer: attempting to load pfx: /var/opt/MediaBrowser/MediaBrowserServer/ssl/cert_9c31b7884ea5475c8687970fc5996297.pfx
2015-03-04 13:31:55.8654 Error - HttpServer: Exception loading certificate: /var/opt/MediaBrowser/MediaBrowserServer/ssl/cert_9c31b7884ea5475c8687970fc5996297.pfx
        *** Error Report ***
        Version: 3.0.5518.7
        Command line: /opt/mediabrowser/MediaBrowser.Server.Mono.exe -programdata /var/opt/MediaBrowser/MediaBrowserServer
        Operating system: Unix 3.13.0.46
        Processor count: 3
        64-Bit OS: True
        64-Bit Process: True
        Program data path: /var/opt/MediaBrowser/MediaBrowserServer
        Mono: 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1)
        Application Path: /opt/mediabrowser/MediaBrowser.Server.Mono.exe
        Input data cannot be coded as a valid certificate.
        System.Security.Cryptography.CryptographicException
          at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0
          at Mono.Security.X509.X509Certificate..ctor (System.Byte[] data) [0x00000] in <filename unknown>:0
          at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.Byte[] rawData, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0
          at System.Security.Cryptography.X509Certificates.X509Certificate2.Import (System.String fileName, System.String password, X509KeyStorageFlags keyStorageFlags) [0x00000] in <filename unknown>:0
          at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor (System.String fileName) [0x00000] in <filename unknown>:0
          at SocketHttpListener.Net.EndPointListener.LoadCertificateAndKey (System.Net.IPAddress addr, Int32 port, System.String certificateLocation) [0x00000] in <filename unknown>:0
        InnerException: System.Security.Cryptography.CryptographicException
        Input data cannot be coded as a valid certificate.
          at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] in <filename unknown>:0

I have tried to delete the pfx but it happens after every restart 

Link to comment
Share on other sites

Try updating mono to a newer version. I think we need to increase our minimum supported version now as a result of supporting https

Link to comment
Share on other sites

that worked perfectly thanks! - updated from mono 3.2.8 to 3.12.0

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update && sudo apt-get dist-upgrade
Link to comment
Share on other sites

thefirstofthe300

You might want to see if you can find mono 3.10 anywhere because 3.12 has a pretty big bug that causes server slowness.

 

Just FYI. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...