# How to get from pem to pfx

**URL:** <https://community.letsencrypt.org/t/how-to-get-from-pem-to-pfx/59961>\
**Category:** Server\
**Created:** [April 19, 2018, 4:15pm UTC](https://community.letsencrypt.org/t/how-to-get-from-pem-to-pfx/59961 "2018-04-19T16:15:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![wuppi](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@wuppi](https://community.letsencrypt.org/u/wuppi)\
**Post date:** [April 20, 2018, 4:51am UTC](https://community.letsencrypt.org/t/how-to-get-from-pem-to-pfx/59961/3 "2018-04-20T04:51:27Z")

</div>

Hi,  
first, thanks for pinpointing me. The command

# openssl pkcs12 -export -out certificate.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem

seems to generate the .pfx

But still my application is not really happy. The line

server.Certificate = new X509Certificate2(“certificate.pfx”,"");

is accepted but once the Client connects the Server tells a Long error Story (see below)  
and I have no Clou how to handle this.

Best

Wuppi

=======================================================================  
[Warn] Failed to Authenticate System.AggregateException: One or more errors occured —\> System.IO.IOException: The authentication or de cryption has failed. —\> System.NotSupportedException: Unsupported security protocol type  
at Mono.Security.Protocol.Tls.Context.DecodeProtocolCode (Int16 code) [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.Server.TlsClientHello.processProtocol (Int16 protocol) [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.Server.TlsClientHello.ProcessAsTls1 () [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in :0  
at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()  
at Mono.Security.Protocol.Tls.ServerRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in : 0  
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in :0  
— End of inner exception stack trace —  
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in :0  
— End of inner exception stack trace —  
–\> (Inner exception 0) System.IO.IOException: The authentication or decryption has failed. —\> System.NotSupportedException: Unsupported security protoco l type  
at Mono.Security.Protocol.Tls.Context.DecodeProtocolCode (Int16 code) [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.Server.TlsClientHello.processProtocol (Int16 protocol) [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.Server.TlsClientHello.ProcessAsTls1 () [0x00000] in :0  
at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in :0  
at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()  
at Mono.Security.Protocol.Tls.ServerRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in : 0  
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in :0  
— End of inner exception stack trace —  
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in :0

---

_[View the full topic](https://community.letsencrypt.org/t/how-to-get-from-pem-to-pfx/59961)._
