function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dr. Thomas MillerDr. Thomas Miller 

Continuous Integration Using Salesforce DX - Wire it all together on Windows

There seems to be an issue in this trailhead module when running it on Windows. Unencrypting the encrypted server key on the Travis server doesn't work.
This seems to be a known issue (https://github.com/travis-ci/travis-ci/issues/4746) and this alternative (https://docs.travis-ci.com/user/encrypting-files/#Using-OpenSSL) didn't work for me as well.
vleandrovleandro
What did you use to install OpenSSL on your Windows machine?  I noticed in the "Create Your Connected App" that there is no link for "Windows complete package.exe installer".  I haven't found an installer yet....
Kenneth SoerensenKenneth Soerensen
I got it working with the manual steps and openSSL found here: https://docs.travis-ci.com/user/encrypting-files/#Using-OpenSSL
Artur FerreiraArtur Ferreira
Im having the same errorI am having this error in travis-ci after running git push
Jaap ScheperJaap Scheper
@vleandro: Download an installer from https://slproweb.com/products/Win32OpenSSL.html and follow the instructions on https://www.youtube.com/watch?v=INFZyVKIO90 on how to install it. Some caveats are pointed out there.
Jakub M. PlatekJakub M. Platek
From what I can see in https://github.com/travis-ci/travis-ci/issues/4746 and https://github.com/benjcunningham/googlecalendar/issues/2 there is no other workaround proposed than just running encryption on a non-Windows machine.
Those issues should be highlighted in the Unit
C R 4C R 4
I think I found a workaround for Windows (not nice as it's a workaround)
1. Manually encrypt your key file with openSSL:
openssl aes-256-cbc -K <YourSecret64BitHexKey> -iv <YourSecret32BitHexIVKey> -in assets/server.key -out assets/server.key.enc
While replacing the Key and the IV with your secret values

2. Update travis
 

travis env set encrypted_<randomNameBoundToYourRepo>_key <YourSecret64BitHexKey>
travis env set encrypted_<2ndRandomNameBountToYourRepo>_iv <YourSecret32BitHexIVKey>

3. Push your server.key.enc file into your repo
4. Wait for the build to succeed

For reference: https://stackoverflow.com/questions/16056135/how-to-use-openssl-to-encrypt-decrypt-files?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
Josip KrajnovićJosip Krajnović
@vleandro

You can find the "Windows complete package.exe installer" here: http://gnuwin32.sourceforge.net/packages/openssl.htm

The following link is almost the same as the instructions in the unit, but only on the heroku website: https://devcenter.heroku.com/articles/ssl-certificate-self

On Windows, replace openssl with "C:\OpenSSL instalation path\openssl.exe", then it will work in CMD.
marie.tournemarie.tourne
Hello thanks @CR4 for your workaround solution on Windows. However I still add the error "iv undefined" when running
openssl aes-256-cbc -K <YourSecret64BitHexKey> -iv <YourSecret32BitHexIVKey> -in assets/server.key -out assets/server.key.enc

so I followed this documentation about encryption keys in travis https://docs.travis-ci.com/user/encryption-keys#usage

I ran the following 
travis encrypt --pro encrypted_<randomNameBountToYourRepo>="YourSecret64BitHexKey" --add

travis encrypt --pro encrypted_<2ndRandomNameBountToYourRepo>_iv="YourSecret32BitHexIVKey" --add

- it is necessary to be logged in first in travis using :
travis login --pro --github-token <github_token>

However I now get the following error
sfdx force:auth:jwt:grant --clientid $CONSUMERKEY --jwtkeyfile assets/server.key --username $USERNAME --setdefaultdevhubusername -a HubOrg
ERROR running force:auth:jwt:grant:  Unexpected argument: assets/server.key

So maybe the yaml line to decrypt the server.key.enc doesn't work - however I don't habe any errors when running :
 
openssl aes-256-cbc -K $encrypted_<randomNameBountToYourRepo> -iv $ncrypted_<2ndRandomNameBountToYourRepo>_iv
  -in assets/server.key.enc -out assets/server.key -d


 If anyone has any idea on how to solve this ! Thanks !