QSslSocket: 无法解析 CRYPTO_num_locks

huangapple go评论160阅读模式
英文:

QSslSocket: cannot resolve CRYPTO_num_locks

问题

我正在尝试使用wkhtmltopdf将HTML渲染为PDF页面。当我尝试调用Create函数时,它给我返回了一堆关于QSslSocket: cannot resolve的错误。有人知道这里发生了什么吗?

这些是错误信息:

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

这些错误是由于缺少SSL库导致的。你需要确保在使用wkhtmltopdf之前,已经正确安装了SSL库。另外,还要确保你的代码中正确引入了相关的库文件。

英文:

I'm trying to use wkhtmltopdf to render a PDF page from HTML. When I try to call Create, it gives me bunch of errors regarding QSslSocket: cannot resolve. Anyone knows what's happening here?

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)
  }
}

These are the errors

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

答案1

得分: 1

你需要使用一个更新的版本的wkhtmltopdf,至少是0.12.5。

英文:

You need to use a more recent version of wkhtmltopdf, at least 0.12.5.

答案2

得分: 0

我找到了这个解决方案,可以解决在Oracle LINUX上运行wkhtmltopdf时的问题:

sudo -i yum install compat-openssl10.x86_64
英文:

I found this and it fixed the problem trying to run wkhtmltopdf on Oracle LINUX:

sudo -i yum install compat-openssl10.x86_64

答案3

得分: 0

我正在使用0.12.4版本,升级到了0.12.6版本。这对我解决了问题!

wkhtmltopdf.org/downloads.html

computingforgeeks.com上的安装指南

英文:

I was using 0.12.4 and upgraded to 0.12.6. Solved it for me!

wkhtmltopdf.org/downloads.html

install guide on computingforgeeks.com

huangapple
  • 本文由 发表于 2022年9月26日 11:42:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/73849434.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定