QSslSocket: 无法解析 CRYPTO_num_locks

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

QSslSocket: cannot resolve CRYPTO_num_locks

问题

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

这些是错误信息:

  1. Loading pages (1/6)
  2. QSslSocket: cannot resolve CRYPTO_num_locks ] 10%
  3. QSslSocket: cannot resolve CRYPTO_set_id_callback
  4. QSslSocket: cannot resolve CRYPTO_set_locking_callback
  5. QSslSocket: cannot resolve sk_free
  6. QSslSocket: cannot resolve sk_num
  7. QSslSocket: cannot resolve sk_pop_free
  8. QSslSocket: cannot resolve sk_value
  9. QSslSocket: cannot resolve SSL_library_init
  10. QSslSocket: cannot resolve SSL_load_error_strings
  11. QSslSocket: cannot resolve SSLv3_client_method
  12. QSslSocket: cannot resolve SSLv23_client_method
  13. QSslSocket: cannot resolve SSLv3_server_method
  14. QSslSocket: cannot resolve SSLv23_server_method
  15. QSslSocket: cannot resolve X509_STORE_CTX_get_chain
  16. QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
  17. QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
  18. QSslSocket: cannot resolve SSLeay
  19. QSslSocket: cannot call unresolved function CRYPTO_num_locks
  20. QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
  21. QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
  22. QSslSocket: cannot call unresolved function SSL_library_init
  23. QSslSocket: cannot call unresolved function SSLv23_client_method
  24. QSslSocket: cannot call unresolved function sk_num
  25. QSslSocket: cannot call unresolved function SSLv23_client_method2%
  26. QSslSocket: cannot call unresolved function SSL_library_init
  27. Counting pages (2/6)
  28. Resolving links (4/6)
  29. Loading headers and footers (5/6)
  30. Printing pages (6/6)
  31. Done
  32. Exit with code 1 due to network error: UnknownNetworkError
  33. QSslSocket: cannot call unresolved function CRYPTO_num_locks
  34. QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
  35. 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?

  1. func main() {
  2. tmpl, _ := template.ParseFiles("docs/template.html")
  3. if err != nil {
  4. fmt.Println(err)
  5. }
  6. tempBuff := new(bytes.Buffer)
  7. err = tmpl.Execute(tempBuff, data)
  8. if err != nil {
  9. fmt.Println(err)
  10. }
  11. page := wkhtmltopdf.NewPageReader(tempBuff)
  12. pdfGen, err := wkhtmltopdf.NewPDFGenrator()
  13. if err != nil {
  14. fmt.Println(err)
  15. }
  16. pdfGen.AddPage(page)
  17. pdfGen.Orientation.Set(wkhtmltopdf.OrientationLandscape)
  18. pdfGen.Dpi.Set(300)
  19. // Error happens here
  20. err = pdfGen.Create()
  21. if err != nil {
  22. fmt.Println(err)
  23. }
  24. }

These are the errors

  1. Loading pages (1/6)
  2. QSslSocket: cannot resolve CRYPTO_num_locks ] 10%
  3. QSslSocket: cannot resolve CRYPTO_set_id_callback
  4. QSslSocket: cannot resolve CRYPTO_set_locking_callback
  5. QSslSocket: cannot resolve sk_free
  6. QSslSocket: cannot resolve sk_num
  7. QSslSocket: cannot resolve sk_pop_free
  8. QSslSocket: cannot resolve sk_value
  9. QSslSocket: cannot resolve SSL_library_init
  10. QSslSocket: cannot resolve SSL_load_error_strings
  11. QSslSocket: cannot resolve SSLv3_client_method
  12. QSslSocket: cannot resolve SSLv23_client_method
  13. QSslSocket: cannot resolve SSLv3_server_method
  14. QSslSocket: cannot resolve SSLv23_server_method
  15. QSslSocket: cannot resolve X509_STORE_CTX_get_chain
  16. QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
  17. QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
  18. QSslSocket: cannot resolve SSLeay
  19. QSslSocket: cannot call unresolved function CRYPTO_num_locks
  20. QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
  21. QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
  22. QSslSocket: cannot call unresolved function SSL_library_init
  23. QSslSocket: cannot call unresolved function SSLv23_client_method
  24. QSslSocket: cannot call unresolved function sk_num
  25. QSslSocket: cannot call unresolved function SSLv23_client_method2%
  26. QSslSocket: cannot call unresolved function SSL_library_init
  27. Counting pages (2/6)
  28. Resolving links (4/6)
  29. Loading headers and footers (5/6)
  30. Printing pages (6/6)
  31. Done
  32. Exit with code 1 due to network error: UnknownNetworkError
  33. QSslSocket: cannot call unresolved function CRYPTO_num_locks
  34. QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
  35. 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时的问题:

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

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

  1. 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:

确定