Coder Social home page Coder Social logo

Comments (9)

martin-s avatar martin-s commented on July 19, 2024 1

I compared it to a bash console and looked what's going on. Following solution is available for Windows console (e.g. batch script):

set PRIV_KEY=account.key
(echo | set /p dummyName="ey...") | openssl dgst -sha256 -hex -sign %PRIV_KEY% -out out.sign

Problem is the bash echo -n (echo without newline) which has to simulated in Windows environment. The Windows solution echo | set /p dummyName="ey..." will print the string without any newline or space character at the end and additionally not raise any errorlevel.

The resulting hex code in file out.sign can be used for step 3 and works.

from gethttpsforfree.

huanjue avatar huanjue commented on July 19, 2024

Me too.

from gethttpsforfree.

konstantinpae avatar konstantinpae commented on July 19, 2024

same here

from gethttpsforfree.

martin-s avatar martin-s commented on July 19, 2024

Same error 400 here. Tried with hex codes in format
"(stdin)= f2c..." and (stdin)= f2c...

Actions are:

set PRIV_KEY=account.key
echo "ey..." | openssl dgst -sha256 -hex -sign %PRIV_KEY%>out.sign

The signature in out.sign contains the hex code which I enter in step 3.The key is the private key of my account. The standard input (in echo command) is taken from website in step3.
The environment is windows 7, OpenSSL 1.0.2f.
Post request includes JWK token, payload, protected and signature elements. Any hints on this?

from gethttpsforfree.

yamanoor avatar yamanoor commented on July 19, 2024

Just adding my voice. Tried to get the entire code in one line, etc, but still fails every time in Windows 7.

from gethttpsforfree.

durcar86 avatar durcar86 commented on July 19, 2024

I ended up using https://www.startssl.com/Account to validate my crt file. The Website is a little slow, but in the end i was able to get it working. Best of Luck

from gethttpsforfree.

chisleu avatar chisleu commented on July 19, 2024

Mac OSX here w/ ubuntu in the back. Same problem.

from gethttpsforfree.

diafygi avatar diafygi commented on July 19, 2024

Like @martin-s said, this error is likely because your echo is adding a newline in the signature. Be sure to either use echo -n or printf when piping the body into openssl.

from gethttpsforfree.

AlpacaNox avatar AlpacaNox commented on July 19, 2024

@Marti-S Thank you so much!

from gethttpsforfree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.