Mam dość ciekawy problem, mianowicie łącząc się z API cloudflare'a, dane pobieram i ustawiam poprawnie w ich usłudze, jednakże jedynie z update'em rekordów DNS mam problem.

Normalny request i response wygląda np. tak:

Request:
  1. * About to connect() to www.cloudflare.com port 443 (#0)
  2. * Trying 190.93.240.253...
  3. * Connected to www.cloudflare.com (190.93.240.253) port 443 (#0)
  4. * successfully set certificate verify locations:
  5. * CAfile: none
  6. CApath: /etc/ssl/certs
  7. * SSL connection using ECDHE-RSA-RC4-SHA
  8. * Server certificate:
  9. * subject: businessCategory=Private Organization; serialNumber=4710875; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; C=US; ST=California; L=San Francisco; street=655 3rd St.; OU=Internet Security and Acceleration; O=CloudFlare, Inc.; CN=www.cloudflare.com
  10. * start date: 2012-12-04 13:37:49 GMT
  11. * expire date: 2013-12-05 13:37:49 GMT
  12. * subjectAltName: www.cloudflare.com matched
  13. * issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Extended Validation CA - G2
  14. * SSL certificate verify ok.
  15. > POST /api_json.html HTTP/1.1
  16. Host: www.cloudflare.com
  17. Accept: */*
  18. Content-Length: 480
  19. Expect: 100-continue
  20. Content-Type: multipart/form-data; boundary=----------------------------b6b7821d9f97
  21.  
  22. < HTTP/1.1 100 Continue
  23. < HTTP/1.1 200 OK
  24. < Server: cloudflare-nginx
  25. < Date: Fri, 10 May 2013 09:47:45 GMT
  26. < Content-Type: application/json
  27. < Content-Length: 6925
  28. < Connection: keep-alive
  29. < Expires: Thu, 19 Nov 1981 08:52:00 GMT
  30. < Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  31. < Pragma: no-cache
  32. < Set-Cookie: vses={WYCIETE}; path=/; domain=.cloudflare.com; secure; HttpOnly
  33. < Set-Cookie: CF_UALE=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT
  34. < Vary: Accept-Encoding
  35. < Cf-Railgun: c93c6d0bcc 0.05 0.114784 0030 0f35
  36. < Set-Cookie: __cfduid={WYCIETE}; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.cloudflare.com
  37. < CF-RAY: 6c5b5b721ce00e0
  38. <
  39. * Connection #0 to host www.cloudflare.com left intact


Response:
  1. stdClass Object
  2. (
  3. [request] => stdClass Object
  4. (
  5. [act] => rec_load_all
  6. )
  7.  
  8. [response] => stdClass Object
  9. (
  10. [recs] => stdClass Object
  11. (
  12. [has_more] =>
  13. [count] => 15
  14. [objs] => Array
  15. (
  16. [14] => stdClass Object
  17. (
  18. [rec_id] => {WYCIETE}
  19. [rec_tag] => {WYCIETE}
  20. [zone_name] => odev.pl
  21. [name] => odev.pl
  22. [display_name] => odev.pl
  23. [type] => TXT
  24. [prio] =>
  25. [content] => content_test
  26. [display_content] => content_test
  27. [ttl] => 1
  28. [ttl_ceil] => 86400
  29. [ssl_id] =>
  30. [ssl_status] =>
  31. [ssl_expires_on] =>
  32. [auto_ttl] => 1
  33. [service_mode] => 0
  34. [props] => stdClass Object
  35. (
  36. [proxiable] => 0
  37. [cloud_on] => 0
  38. [cf_open] => 1
  39. [ssl] => 0
  40. [expired_ssl] => 0
  41. [expiring_ssl] => 0
  42. [pending_ssl] => 0
  43. [vanity_lock] => 0
  44. )
  45.  
  46. )
  47.  
  48. )
  49.  
  50. )
  51.  
  52. )
  53.  
  54. [result] => success
  55. [msg] =>
  56. )
  57.  


Natomiast w przypadku requestu update'ującego rekord DNS request wygląda jak poniżej, natomiast odpowiedzi brak.

  1. * About to connect() to www.cloudflare.com port 443 (#0)
  2. * Trying 141.101.123.253...
  3. * Connected to www.cloudflare.com (141.101.123.253) port 443 (#0)
  4. * successfully set certificate verify locations:
  5. * CAfile: none
  6. CApath: /etc/ssl/certs
  7. * SSL connection using ECDHE-RSA-RC4-SHA
  8. * Server certificate:
  9. * subject: businessCategory=Private Organization; serialNumber=4710875; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; C=US; ST=California; L=San Francisco; street=655 3rd St.; OU=Internet Security and Acceleration; O=CloudFlare, Inc.; CN=www.cloudflare.com
  10. * start date: 2012-12-04 13:37:49 GMT
  11. * expire date: 2013-12-05 13:37:49 GMT
  12. * subjectAltName: www.cloudflare.com matched
  13. * issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Extended Validation CA - G2
  14. * SSL certificate verify ok.
  15. * couldn't open file ""
  16. * Connection #0 to host www.cloudflare.com left intact


Dane jakie wysyłam w celu aktualizacji:
  1. array(9) {
  2. 'a' =>
  3. string(8) "rec_edit"
  4. 'z' =>
  5. string(7) "odev.pl"
  6. 'type' =>
  7. string(3) "TXT"
  8. 'id' =>
  9. string(8) "{WYCIETE}"
  10. 'name' =>
  11. string(1) "@"
  12. 'content' =>
  13. string(13) "content_teasd"
  14. 'ttl' =>
  15. int(1)
  16. 'email' =>
  17. string(12) "{WYCIETE}"
  18. 'tkn' =>
  19. string(37) "{WYCIETE}"
  20. }
  21.  


Najciekawszą rzeczą jest, że wygląda jakby cURL chciał wysłać/pobrać jakiś plik(?) - couldn't open file "" - a przecież wysyłam array, pobieram JSON string.

ANY IDEA?