Hello Yavuz,


thanks for trying the branch.   Your CURL seems to be correct (the one with the developmentCertificate and developmentPassphrase).


However, since we changed the model, I think you need to erase your local database :-) I remember running into that as well, when testing the things.

the DB is stored on the filesystem.  Please try the following steps:
* stop the JBoss
* Kill the DB: do "rm ~/pushee.*"
* start JBoss again

Now, you need to login, and create a PushApp and than, use the above CURL for adding the developmentCert...



BTW. a PRODUCTION :) cert is added like this:
curl -v -b cookies.txt -c cookies.txt -i -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "productionCertificate=@/Users/matzew/Desktop/PushCerts/PushTest.p12" -F "productionPassphrase=TopSecret" -X POST http://localhost:8080/ag-push/rest/applications/{pushApplicationID}/iOS


AND :)  You can also upload both certs, initially:

curl -v -b cookies.txt -c cookies.txt -i -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "developmentCertificate=@/Users/yavuz/Documents/Certificates.p12" -F "developmentPassphrase=pass" -F "productionCertificate=@/Users/matzew/Desktop/PushCerts/PushTest.p12" -F "productionPassphrase=TopSecret" -X POST http://localhost:8080/ag-push/rest/applications/{pushApplicationID}/iOS



Hope that helps








On Wed, Jul 10, 2013 at 6:24 PM, Yavuz Selim YILMAZ <yavuzsel@buffalo.edu> wrote:
Hi all,

I'm trying out the ProdCerts branch on aerogear-unified-push-server to enable AeroGear powered push notifications on my production iOS application.

When I am trying to add an iOS variant, I am getting:

HTTP/1.1 400 Bad Request
The request sent by the client was syntactically incorrect ().

The curl command I am using is here:

$curl -i -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "developmentCertificate=@/Users/yavuz/Documents/Certificates.p12" -F "developmentPassphrase=pass" -X POST http://localhost:8080/ag-push/rest/applications/8055d0a9-ed30-463c-9ac3-baf8cee39ebc/iOS

As far as I could see, Bad Request is returned if developmentCertificate and/or developmentPassphrase is null (in my case, productionCertificate/Passphrase are already null). Therefore, in order to make sure my Certificates.p12 does not read null , I switched to master branch, and executed the following command successfully and add my variant:

$curl -i -b cookies.txt -c cookies.txt -H "Accept: application/json" -H "Content-type: multipart/form-data" -F "certificate=@/Users/yavuz/Documents/Certificates.p12" -F "passphrase=pass" -X POST http://localhost:8080/ag-push/rest/applications/688d0fe1-4cc2-4606-ab10-09660620b483/iOS

Any ideas why I might be getting this error, or any suggestions/directions are most appreciated.

Kind regards,

---
Yavuz Selim Yilmaz
SUNY at Buffalo
Computer Science and Engineering
PhD Candidate


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf