'Why cant I use slackSend to send Build status reports

So I am trying to use slackSend to send build status reports over a slack channel. My script looks like this-

def notifyBuild(String buildStatus = 'STARTED') {
  // build status of null means successful
  buildStatus =  buildStatus ?: 'SUCCESSFUL'

  // Default values
  def colorName = 'RED'
  def colorCode = '#FF0000'
  def subject = "${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
  def summary = "${subject} (${env.BUILD_URL})"

  // Override default values based on build status
  if (buildStatus == 'STARTED') {
    color = 'YELLOW'
    colorCode = '#FFFF00'
  } else if (buildStatus == 'SUCCESSFUL') {
    color = 'GREEN'
    colorCode = '#00FF00'
  } else {
    color = 'RED'
    colorCode = '#FF0000'
  }

  // Send notifications
  slackSend (color: colorCode, message: summary)
}

node ('apps-linux26-loadbuild') {
  try {
    notifyBuild('STARTED')

  stage "CO"
  currentBuild.description = "$BRANCH_NAME@$BRANCH_REV<br>"
    checkout([
      $class: 'SubversionSCM',
      additionalCredentials: [],
      excludedCommitMessages: '',
      excludedRegions: '',
      excludedRevprop: '',
      excludedUsers: '',
      filterChangelog: false,
      ignoreDirPropChanges: false,
      includedRegions: '',
      locations: [[
        credentialsId: '33a83c9b-75d1b',
        depthOption: 'infinity',
        ignoreExternalsOption: true,
        local: "$BRANCH_NAME",
        remote: "svn://xyz-repo/svn/ccsmp/$BRANCH_NAME@$BRANCH_REV"
      ]],
      workspaceUpdater: [$class: 'UpdateUpdater'],
      quietOperation: true
    ])
  } catch (e) {
    currentBuild.result = "FAILED"
    throw e
  } finally {
    notifyBuild(currentBuild.result)
  }
}

However I keep getting this error-

WARNING jenkins.plugins.slack.StandardSlackService publish
Error posting to Slack
javax.net.ssl.SSLException: Received fatal alert: protocol_version
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    .
    .

I even tried something as simple as slackSend color: '#BADA55', message: 'Hello, World!' But still I get the same error. Im using an old version of jenkins (1.609) and I cant really update that. But I dont think this error is related to that.

Please help me I will highly appreciate any suggestions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source