Is there a way to build a Golang Windows program that allows it to be recognized from a known publisher?

xuanbao · · 500 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>When I build my Golang app using <a href="https://github.com/karalabe/xgo">xgo</a> on a Ubuntu host I can get a Windows binary. When I run this binary in Windows, though, Windows <a href="https://imgur.com/78RdsoV">shows a blue window</a> saying it has &#34;prevented an unrecognized app from starting.&#34; <strong>Is there a way to sign a Golang-built Windows app so that Windows will recognize the publisher and<br/> suppress <a href="https://imgur.com/78RdsoV">this warning</a>?</strong></p> <p>I realize that you can just click &#34;Run Anyway&#34; to run the app, but I&#39;m sure the occurrence of this message is enough to influence people to not use the program. If suppressing this ad requires signing up for Windows Store or something, I&#39;m happy to do it - I just don&#39;t know where to begin. </p> <hr/>**评论:**<br/><br/>1lann: <pre><p>I haven&#39;t done it myself, but this is the first result on Google: <a href="https://stackoverflow.com/questions/252226/signing-a-windows-exe-file">https://stackoverflow.com/questions/252226/signing-a-windows-exe-file</a></p></pre>qrv3w: <pre><p>Thanks, I had trouble finding this with Google :) </p> <p>I will give the Windows SignTool a try.</p></pre>JHunz: <pre><p>You will need an actual Authenticode code-signing certificate to suppress the warning for end users, by the way. Test signing and self signing can be set up to bypass smartscreen on your local machine but you will need an actual cert for end users</p></pre>Creshal: <pre><p>Signtool works, I&#39;m using it with our go programs. </p> <p>Still need a code-signing cert, though.</p></pre>nathanpaulyoung: <pre><p>Are there free cert providers, or is it just Verisign basically?</p></pre>PaluMacil: <pre><p>I have been frustrated before at the expense of it, but after thinking about how they really are verifying that you are a company you say you are, it probably can&#39;t be cheap or free. In the case of letsencrypt, the main objective is encryption / proving that you&#39;re talking to the same server you asked to talk to. Software is a bit different, more comparable to extended validation.</p></pre>mkishere: <pre><p>Just a little bit offtopic, what is the advantage of using xgo instead of the official way of cross compiling? i.e. GOOS=windows go build ?</p></pre>qrv3w: <pre><p>In my case I&#39;m using it to cross-compile something that uses a lot of CGO libraries (e.g. <a href="https://github.com/mattn/go-sqlite3" rel="nofollow">go-sqlite3</a>). Since I&#39;m using linux as a host, building a OS X app that uses <code>go-sqlite3</code> requires me to get an Apple Developer account, get the right version of Xtools, and then build the OS X SDK to build the sqlite3-compatible o64-clang compiler with <code>osxcross</code>. Windows is a similar headache.</p> <p><code>xgo</code> is really cool in this respect because it leverages a docker container which already has all these compilers bulit-in and uses them automatically.</p></pre>JackOhBlades: <pre><p>It builds for all platforms and architectures in parallel. </p></pre>akerro: <pre><p>I didn&#39;t see this warning in Syncthing last time I used it on Windows7</p></pre>jammerlt: <pre><p>Because syncthing bought the certificate and signs the binary.</p></pre>: <pre><p>[removed]</p></pre>garlicbot: <pre><p><a href="https://i.imgur.com/dYGNvmR.jpg" title="Reddit Garlic" rel="nofollow"><strong>Here&#39;s your Reddit Garlic, qrv3w!</strong></a> </p> <p><a href="/u/qrv3w" rel="nofollow">/u/qrv3w</a> has received garlic 1 time. (given by <a href="/u/pythonETH" rel="nofollow">/u/pythonETH</a>) </p> <p><sup>I&#39;m</sup> <sup><sup>a</sup></sup> <sup><sup><sup>bot</sup></sup></sup> <sup><sup><sup><sup>for</sup></sup></sup></sup> <sup><sup><sup><sup>questions</sup></sup></sup></sup> <sup><sup><sup><sup><sup>contact</sup></sup></sup></sup></sup> <sup><sup><sup><sup><sup><a href="/u/flying_wotsit" rel="nofollow">/u/flying_wotsit</a></sup></sup></sup></sup></sup></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

500 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传