Joe
Joe

Reputation: 83

Slack Curl not working

A have a script that is sending messages to a slack channel perfectly.The script is placed on a test server with the following curl Version:

curl --version curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Protocols: tftp ftp telnet dict ldap http file https ftps Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

When the same script is placed on the second server with the same curl version, it is displaying me the following curl message:

curl: (35) error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message digest algorithm

My code:

curl -H "Content-type:application/json" \
  -X POST -d \
  '{
     "channel" : "#'"$ROOM"'",
     "username" : "'"$USERNAME"'",
     "icon_emoji" : ":'"$EMOJI"':",
     "attachments" : [
       {
         "fallback" : "'"$TITLE_1"'",
         "color" : "'"$COLOR"'",
         "fields" : [
           {
             "title" : "'"$TITLE_1"'",
             "value" : "'"$MSG_1"'"
            }
          ]
        }
      ]
  }' $SLACK_URL_HOOK

Please help, i need to know why it is not working on the main server.

Thanks

Upvotes: 0

Views: 567

Answers (1)

Joe
Joe

Reputation: 83

Was able to figure it out. Added the -k as --none-secure message to the curl.

Now Looks like this:

curl -k -H "Content-type:application/json" \
  -X POST -d \
  '{
     "channel" : "#'"$ROOM"'",
     "username" : "'"$USERNAME"'",
     "icon_emoji" : ":'"$EMOJI"':",
     "attachments" : [
       {
         "fallback" : "'"$TITLE_1"'",
         "color" : "'"$COLOR"'",
         "fields" : [
           {
             "title" : "'"$TITLE_1"'",
             "value" : "'"$MSG_1"'"
            }
          ]
        }
      ]
  }' $SLACK_URL_HOOK

Upvotes: 1

Related Questions