This tweak exists to work around this issue.
You will need to disable System Integrity Protection in order for this to work.
Install at your own risk :smiley::
$ git clone https://github.com/conradev/codesign_fix.git
$ cd codesign_fix
$ make
$ sudo mv /usr/bin/codesign /usr/bin/codesign_old
$ sudo ln -s $PWD/codesign /usr/bin/codesign
To uninstall, undo the changes made above:
$ sudo rm /usr/bin/codesign
$ sudo mv /usr/bin/codesign_old /usr/bin/codesign
$ make clean