# Client authentication fails with .Pfx file

**URL:** <https://forum.confluent.io/t/client-authentication-fails-with-pfx-file/5522>\
**Category:** Non-Java Clients\
**Created:** [12 July 2022 20:29 UTC](https://forum.confluent.io/t/client-authentication-fails-with-pfx-file/5522 "2022-07-12T20:29:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkNaughton](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@MarkNaughton](https://forum.confluent.io/u/MarkNaughton)\
**Post date:** [12 July 2022 20:29 UTC](https://forum.confluent.io/t/client-authentication-fails-with-pfx-file/5522/1 "2022-07-12T20:29:53Z")

</div>

The following configs work on Windows Server running confluent kafka 1.9.0.

{  
“Settings”: {  
“BootstrapServers”: “[server.com:9093](http://server.com:9093)”,  
“Topic”: “MyTopic”,  
“SecurityProtocol”: “ssl”,  
“GroupId”: “myappid”,  
“ClientId”: “myClientID”,  
“SslCaLocation”: “rootca.cer”,  
“SslKeyLocation”: “KeysFromPfxFile.pem”,  
“SslKeyPassword”: “mypassword”,  
“SslCertificateLocation”: “CertFromPFXFile.pem”  
}  
}

The following configs do not work although the .pfx is the same file  
the above .pems were exported

{  
“Settings”: {  
“ConsumerRun”: “true”,  
“BootstrapServers”: “[server.com:9093](http://server.com:9093)”,  
“Topic”: “MyTopic”,  
“SecurityProtocol”: “ssl”,  
“GroupId”: “myappid”,  
“ClientId”: “myClientID”,  
“SslCaLocation”: “rootca.cer”,  
“SslKeystorePassword”: “mypassword”,  
“SslKeystoreLocation”: “PFXFile.pfx”,  
“SslKeyPassword”: “mypassword”  
}  
}

System.InvalidOperationException: Error reading ssl.keystore.location PKCS#12 file: esscdcportalappiddev.us.bank-dns.com.pfx: error:0D06B08E:asn1 encoding routines:asn1\_d2i\_read\_bio:not enough data  
at Confluent.Kafka.Impl.SafeKafkaHandle.Create(RdKafkaType type, IntPtr config, IClient owner)  
at Confluent.Kafka.Producer`2..ctor(ProducerBuilder`2 builder)  
at Confluent.Kafka.ProducerBuilder`2.Build()  
at ConsolKafka\_Producer.Program.Main(String args) in C:\Users\c079009\OneDrive\Projects\Kafka\_Producer\ConsolKafka\_Producer\Program.cs:line 221
