REST API receiving association failed

My config file.

{
“Name” : “Orthanc”,
“StorageDirectory” : “/var/lib/orthanc/db-v3”,
“IndexDirectory” : “/var/lib/orthanc/db-v3”,
“StorageCompression” : true,
“MaximumStorageSize” : 0,
“MaximumPatientCount” : 0,
“LuaScripts” : [
],
“Plugins” : [
“/etc/orthanc/orthancwebbuild/libOrthancWebViewer.so”
],
“HttpServerEnable” : true,
“HttpPort” : 8000,
“HttpDescribeErrors” : true,
“HttpCompressionEnable” : true,
“DicomServerEnable” : true,
“DicomAet” : “ORTHANC”,
“DicomCheckCalledAet” : false,
“DicomPort” : 11112,
“DefaultEncoding” : “Latin1”,
“DeflatedTransferSyntaxAccepted” : true,
“JpegTransferSyntaxAccepted” : true,
“Jpeg2000TransferSyntaxAccepted” : true,
“JpegLosslessTransferSyntaxAccepted” : true,
“JpipTransferSyntaxAccepted” : true,
“Mpeg2TransferSyntaxAccepted” : true,
“RleTransferSyntaxAccepted” : true,
“RemoteAccessAllowed” : true,
“SslEnabled” : false,
“SslCertificate” : “certificate.pem”,
“AuthenticationEnabled” : true,
“RegisteredUsers” : {
“admin” : “admin”
},

“DicomModalities” : {
“local” : [ “ORTHANC”, “localhost”, 11112 ]
},

“OrthancPeers” : {
},
“UserMetadata” : {
},
“StableAge” : 60,
“HttpServerEnabled” : true,
“DicomServerEnabled” : true,
“StrictAetComparison” : false,
“StoreMD5ForAttachments” : true,
“LimitFindResults” : 0,
“LimitFindInstances” : 0,
“LimitJobs” : 10,
“LogExportedResources” : true,
“KeepAlive” : false,
“StoreDicom” : true,
“DicomAssociationCloseDelay” : 5,
“QueryRetrieveSize” : 10,
“CaseSensitivePN” : false
}

DO query

curl http://localhost:8000/modalities/local/find-patient -X POST -d ‘{“PatientName”:“*”,“PatientSex”:“M”}’

I receive an error how to solve this problem?

cat /var/log/orthanc/Orthanc.ERROR
Log file created at: 2015/09/21 01:00:14
Running on machine: pacs
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
E0921 01:00:14.493993 24826 CommandDispatcher.cpp:456] Receiving Association failed: Unrecognized PDU type: 50

You have enabled HTTP authentication, so you need to give the credentials to curl. The following command will work:

curl http://admin:admin@localhost:8000/modalities/local/find-patient -X POST -d ‘{“PatientName”:“*”,“PatientSex”:“M”}’ -v

Please also note that, according to the format of the log, you do not use the latest version of Orthanc.

Sébastien-

Thank you for your response. You really helped.
Thank you for your work on this project.