登录
首页 >  Golang >  Go问答

无法解析 QSslSocket 的 CRYPTO_num_locks

来源:stackoverflow

时间:2024-02-09 08:30:19 279浏览 收藏

你在学习Golang相关的知识吗?本文《无法解析 QSslSocket 的 CRYPTO_num_locks》,主要介绍的内容就涉及到,如果你想提升自己的开发能力,就不要错过这篇文章,大家要知道编程理论基础和实战操作都是不可或缺的哦!

问题内容

我正在尝试使用 wkhtmltopdf 从 html 渲染 pdf 页面。当我尝试调用 create 时,它​​给了我一堆有关 qsslsocket: 无法解析 的错误。有人知道这里发生了什么事吗?

func main() {
  tmpl, _ := template.parsefiles("docs/template.html")
  if err != nil {
    fmt.println(err)
  }

  tempbuff := new(bytes.buffer)

  err = tmpl.execute(tempbuff, data)
  if err != nil {
    fmt.println(err)
  }

  page := wkhtmltopdf.newpagereader(tempbuff)

  pdfgen, err := wkhtmltopdf.newpdfgenrator()
  if err != nil {
    fmt.println(err)
  }

  pdfgen.addpage(page)
  pdfgen.orientation.set(wkhtmltopdf.orientationlandscape)
  pdfgen.dpi.set(300)

  // error happens here
  err = pdfgen.create()
  if err != nil {
    fmt.println(err)
  }
}

这些是错误

Loading pages (1/6)
QSslSocket: cannot resolve CRYPTO_num_locks                  ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method2%
QSslSocket: cannot call unresolved function SSL_library_init
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                                      
Exit with code 1 due to network error: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback

正确答案


我发现了这个,它解决了尝试在 oracle linux 上运行 wkhtmltopdf 的问题:

sudo -i yum install compat-openssl10.x86_64

以上就是本文的全部内容了,是否有顺利帮助你解决问题?若是能给你带来学习上的帮助,请大家多多支持golang学习网!更多关于Golang的相关知识,也可关注golang学习网公众号。

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>